Rails encouraged density around the train stations.
Rail is not responsible for the car sprawling type of communities which are mostly a 20th century phenomenon.