TL;DR
Please, add to train stops new setting 'priority' and change the train pathfinder slightly to choose first by highest priority and then by distance.What ?
1.1 added nice system of train limits, but it lacks one small detail - priority. For now trains choose closest train stop with "empty slots".At first I tried to solve this by circuit networks, I had some clever system which sets train limit to '0' instead of desired 'limit'. And only if all train stops with higher priority are full ( their 'count'=='limit' ), then it will change '0' to 'limit'. It even allowed changing priorities on the fly by circuit network. All worked nice in a testing environment with only one train in the network.
But when I added this to real environment it stopped work, because trains always choose by distance and they are frequently repathing when they see red signal.
Lets narrow this to simple case.
If lower station have train going to it(it's full), it opens upper station. So it works like higher priority to lower station. And it works if nothing triggers a repath. But for example some train is going through crossroad, so our train needs to brake which triggers repath. Then our train sees open closer station and repaths to it. Of course lower station train count becomes 0 and upper station limit becomes 0 too, but no repath now can repath to lower station, because train already reserved slot in upper and will see it as open.
Possible hacky solutions to this:
1. Disable train stops. But disabling is evil and train will swap between stations every repath.
2. Adding circuit controlled signal to add distance penalty. Works better, but penalty is not infinite and more then 1 kilometer distant stations will not work anyway. That's even not talking about some weird situations when train passed through controlled signal and station becomes closed in front of it.
3. Force temporary stops by some script on_train_state_changed. But when train goes to temporary stop it does not reserve slot in next station, so it will not work too...
The only real solution is to change pathfinder algorithm, so it will sort stations by priority and then sort same priority subgroups by distance.
It is not complex solution, it does not require reworking everything with pathfinder logic, just simple change in sorting and adding a couple of events when priority of station is changed.
Now if you want train stop priorities you need to use some overly complicated mods like LTN or TSM, they are heavy, slow, have their own train limit and counting systems which is prone to errors.