Ideally, trains should be built in advance of, not after, residential and commercial development. That is how the subways were built in New York City a century ago, where they extended to the then-rural far reaches of the outer boroughs while the commuter train went to small towns that are now big suburbs. This allowed dense development nodes to spring up around the train stations. As a result, New York has the best mass-transit use in the nation: 57 percent of New York City commuters use mass transit to get to work, whereas 85 percent of the nation's workers need a car to get to their job. New York is also proof that traffic is good: Many of those commuters would drive were it not for Manhattan's density and resulting traffic snarls during business hours.
It's almost impossible to imagine now, but right now we build highways to nowhere in advance of development. That drives the development patterns, and makes it difficult and perhaps pointless to later add in any kind of mass transit. Back in the good old days before widespread automobile use, train lines drove the development patterns, including in the original streetcar city, Los Angeles.