1. 2 outer tracks are the main tracks, each works in its own direction(opposite).
2. The middle tack is a shared one and works in both directions. It should be used only if the main track is busy with a broken or slower train. And trains should get back to the main track as soon as it is possible.

The problem: If I use no signals on the middle track, it will be always used by trains even if their main track is free. From egoistic approach it makes sense to use the middle track if it is free. But I want to let trains only use it to pass other trains on the main track.
I think I need to add some penalty to the middle track, so it will be less preferable to the pathfinding algo. I tried to place PBS so that trains have to approach them from behind and as I understand this method does create some penalty. BUT PBS also create some strange conditions, so trains get stuck when there is clearly a free path.
I created a minimal example to demonstrate that.
Here you can see the main track on top is busy with a stopped train. Another track under it is free and could be used by the second train. But the second train is waiting for free path.
The problem is in the block, pointed by two railroad arrows. Somehow pathfinding algo gets lost in this place even though it can choose any of two ways:
- either through PBS pointed by the lower arrow
- or a free path pointed by the top arrow
I assume, PF gets into a loop or smth in that place, because if I remove either a PBS or a piece of railroad pointed by the arrows, then PF immediately resolves the way.

Anyways, even though I'd like to resolve the general PBS problem in the simplified example, my main issue is how to build a three-track railroad. Maybe I need to use something else, not inverted PBS. Please advice.