"the understandably frightening and chimeric semicolon" -- HiveGod
See What is the essence of railroad games for a good discussion. My own response is here.
Edit: Might as well just quote my response. Then you'll have to go to the trouble of clicking through to see opposing viewpoints.
As has been mentioned, "train games" covers a lot of ground, and different train games scratch different itches.
"Building something" is definitely part of the attraction. It's great fun to build some kind of functional engine, watch it grow, and watch it work for you.
Train games are also usually connectivity contests. Players compete for real estate and connections to strategically important locations. This is a part of train games that I particularly enjoy.
Some train games involve pickup-and-deliver, with competition to make the juiciest deliveries before someone else gets to them. This also usually provides such games with their basic economic engine: you are in a race for connectivity, but expanding your railroad costs money that you can only get by delaying your expansion and making deliveries instead. For anyone who likes economic-engine games, the train model provides a pretty good one.
Some train games are also stock market games, adding another layer of interest and complexity.
Most train games involve a map, and gamers usually really like maps. (I don't know why, but they do. I do too!)
Some train games have historical context, which is an attraction they share with some wargames.
And finally, as several others have pointed out, trains are just plain cool. Chugga-chugga-whoooo!