Same in most parts of Europe.
In Denmark we had lots and lots of little towns and villages that grew up and flourished around the rail roads.
When the railroad died as a means of transportation for produce, so did they.
I just passed through the village of Jerslev Sj. where I grew up last week.
Of the 12 stores, post office and railroad hotel that were there back in my childhood ( Early 60es), none are left today.