I just answered an amazing question on quora.com: “What are the dangers of taking a train to Yellowstone?”
To my mind this is a strange question, but perhaps the person asking it does not know where trains do and do not run in the U.S.
It would be great if there were still trains to one or more of the entrances to the park. However, the last passenger train, the Northern Pacific, to terminate at Gardiner, Montana (the North Entrance) arrived with a passel of Girls Scouts in 1955, and one could only get as far as Livingston on a train up to 1979. The other railroads that took passengers near the park had stopped running trains to the vicinity of Yellowstone even before that.
Your present options are taking a tour bus, flying to one of the gateway towns that has an airport and renting a car, or driving in your own car, which people do from every state in the Union.
Personally, I would think it high time that railroads reconsider the possibility of building tracks back to Gardiner, Cody, and/or West Yellowstone. The National Park Service should then set up shuttle buses to all the major points of interest—if only there were money for such a dream to come true any time soon. . . .