The S2 should actually let the S1 go to the tunnel first, but the switch was set wrong, and the signal for S1 was red and for S2 it was green. In these images you can see the problem.