We examine the effect of spatial differences in access to a railway network on both urbanization and road congestion in a typical 'transport corridor between cities' setup. Using a spatial urban equilibrium model, we find that if the number of access nodes, i.e. stations, is limited, stations contribute to the degree of urbanization. The total effect on road congestion, however, is small. By contrast, if stations are omnipresent there is little effect on urban spatial structure, but a considerable decrease in congestion. This suggests there is a policy trade-off between congestion and urbanization which crucially depends on the type of railway network. We find similar results for a within-city metro network. The key methodological contribution is that, besides the dependence between mode choice and where to work/live, the model allows for differences in the degree of substitutability - local competition - between transport modes. We find that an increase in the substitutability between car travel and railway travel substantially decreases the congestion reduction benefits of a dense railway network.