While most railway routes run between major cities, the stations in between would include fairly large stations which may not be justified by the local population. These could be junctions which have to be at particular locations, or loco sheds and watering/coaling points at suitable intervals preferably with a good water supply, or workshops which need space as well as a suitable supply of skilled and unskilled labor.
I am giving a few samples of each case. This is not meant to be an exhaustive listing, and anyone who wants to enumerate all cases in each category is welcome to do so.
Junctions in small places:
Amla, Arakkonam, Bhusaval, Bina, Daund, Dornakal, Gomoh, Gudur, Guntakal, Itarsi, Jolarpettai, Katni, Kazipet, Kharagpur, Khurda Road, Kiul, Lumding, Manmad, Mughal Sarai, Shoranur, Tundla, Villupuram, Viramgam.
(Of course, some like Mughal Sarai are not too far from larger urban centres.)
Rajasthan has a number of these, e.g. Bandikui, Bayana, Degana, Luni, Marwar, Merta Road, Phulera, Ratangarh.
Loco sheds in small places:
(These include those which are not junctions):
Abu Road, Balharshah, Bitragunta, Dongargarh, Gangapur City, Jhajha.
Major railway workshops/offices in small places not counted so far:
Adra, Alipur Duar, Chakradharpur, Chittaranjan, Dahod, Danapur, Jagadhri, Jamalpur, Kapurthala, Marhaura, Mariani, Podanur, Rangiya, Rewari, Yelahanka.
Sometimes one can guess why a steam loco shed (or at least a watering point) was located at a particular place, considering that steam locos had to stop every 150-200 km.
Considering the Mumbai-Delhi (WR) route:
Valsad is 194 km from MMCT and 197 km from Vadodara.
Gangapur City is 171 km from Kota and 153 km from Mathura.
Try to see the logic of the location of Bitragunta, Dongargarh, Jhajha etc.
However, Balharshah gets in because it was the junction between the GIPR and Nizam’s State Railway, where most trains changed their locos.