Isn't this statement kinda backwards though? Surely the big cities developed along that line due to the natural geography (flat land, near bodies of water and with protection from the mountains) and then once trains first came along, it made sense to connect those cities. It's not that people happen to live within 5km of the trainline, but that the trainline was built there because that's where people lived.
You’re absolutely right. That train runs across the Swiss Plateau with mountains either side of the plateau. Historically, if you were going to grow any produce, that was where you would grow it so it’s no surprise there’s such a density of people in the flatter part of an extremely mountainous country.