Earlier quoted context omitted.
I think that puts the cart before the horse. Why build a railroad to no-where? Surely the small towns pre-existed the railroad.
The two end stations existed, and enough in between the make the railway feasible. Then the existence of paths to two big cities made some villages grow, and grow, and grow.
What you're arguing is that there are towns that would pop up around these railways after the fact, and while that's true, they would also pop up around water, gold, and other natural resources.
It turns out there's lots of reasons why communities form, but one thing we know for sure is that railways require demand FIRST, not second.