This is by far one of the greatest ways to see the canyon area (and until a few years ago when a through-road was completed, the ONLY way to get through the canyon). There are several classes of train - there's a private luxury train with organized tours that travel through the area, travelling south from Tucson, AZ. There are also 2 classes of "standard" train service - first and second class. The prices are unbelievably low for tourists, considering exchange rates. First class is entirely affordable and comfortable, though travelling in second class with more of the local citizens and less tourists clearly has it's draw. You can elect to travel independently, or with a guided tour. Many people were surprised to discover that we were travelling alone - I'm not fond of being part of tour groups, but the advantage of having a local guide to inform you of lots of information, lore, etc. is clearly an advantage to consider. If you're going independently, definitely do your research on the area before you go - you'll get a lot more out of it.
The train trip is worth far more than the meagre price of the ticket! It's an engineering marvel that took nearly 100 years to complete, and winds its way through the Sierra Madre mountains, from low desert scrub, across bridges, through tunnels blasted through mountains (80 or more tunnels and bridges altogether!), along precipitous cliffs, alpine meadows - most any environment you could imagine. Your train ticket is good for any amount of boarding/disembarking, so as long as you've bought a fare from your start point to end point, you can get on and off and enjoy the scenery off the track. One word of warning - I don't think the train has operated on time once since it's been in operation - at times, our trains were delayed 4 hours or more - just be flexible and patient with your plans. There is only a single track and two-way traffic, so the trains often have to pull out on spurs, back up, or wait at stations for oncoming trains to pass. Just consider it as an opportunity to enjoy more of the scenery. There are the unusual unexpected thrills along the ride - passing over bridges and seeing the wreckage of derailed trains fall below, and the occasional story of mudslides, derailments, etc. that shut the line down for days. Not to alarm you, but do be prepared to be patient, as nature takes it's course on this route. On my last day in the canyon, we delayed for hours on a spur, waiting for a freight train to rumble past in the night- and the next morning we heard we were extremely lucky, as the overloaded frieght train did derail and take some of the track with it, which was going to shut down the line for days!
Even if you're not getting off at a station, check with the conductor about how long the train will be there - sometimes trains have to wait at the stations for passing trains, crew changes, etc., and you may have a chance to jump off and do some walking around or grab a bite to eat (or souvenir to take home) at the impromptu stands set up on the platforms each time the train arrives. Take advantage of any delay or opportunity arises - this is sure to be one of the greatest train trips of your lifetime!