Here's a video that shows the whole collision process. Sorry about the low framerate, potato computer.
https://webmshare.com/play/MJPxd
The blue train reserves the intersection, entering at high speed. When it is completely inside the upper loop it stops reserving the intersection, even though it can't stop in time. It still reserves the blue exit block, just the intersection is unreserved. Meanwhile, the green train sees the intersection become free and enters, travelling towards the green exit block. The blue train reenters the intersection at high speed and causes a collision.
Here's a screenshot of the moment the blue train erroneously releases its reservation on the intersection. I've marked all the signals so you can more easily see the colours. The blue train is travelling at high speed while the green train is stationary. Also notice that the debug braking distance at the moment the blue train exits the intersection is already back inside the intersection. If that distance is inside the loop instead, the bug doesn't occur. I've attached a small save that demonstrates the problem, just short-circuit the combinator to start the trains.
I've tried some variations and they illustrate the inconsistency of this problem.
- If the blue train is slower (connect the shorter track on the right), it properly sets the intersection signals to yellow.
If the blue train is instructed to use the alternative train stop (delete Blue Exit in the blue train), it slows down enough and properly sets yellow signals.
If the green train is instructed to use the alternative train stop (delete Green Exit in the green train), it sees the blue train reserve that exit block (but not the intervening intersection) and correctly doesn't pass the chain signal into the intersection because its desired exit is busy.
If the two signals in the loop are removed (rail and chain signals), the loop becomes part of the intersection block and of course the intersection doesn't get unreserved. I don't consider this to be a solution, it just hides the problem.
Save, log, and video are also available at https://www.dropbox.com/sh/gtu7z6yjuifz ... kFqTa?dl=0
I apologise for the biters which attack the factory, they don't come near the railway so it shouldn't interfere with the demonstration.