This is the railway for test

4 trains from station A to station B loop (yellow)
1 train from station C to station D loop (green)
The purpose of middle rail is through this traffic jam for someone who destination not station A.(like green train)
But some time I got this

A train wait at B point block other train enter station B
and it want to use middle rail and overtake some train who before it
It's ineffective for railway How can I fix this
When the station A is blocked
I want the yellow train who stop at point B go ahead and stop as close as possible station A
like this
