Originally shared on the public FactorioPrints / Factorio School archive (factorioprints.com · factorio.school). Authorship preserved from the public catalog.
The idea of this system is to have two lines to each direction to enable more possibilities of trafic. So, the train can choose what way has lass trafic and change the line. The crossing has a system that allow the train to chance direction and the line too. The lines has a default direction, but if you want to change, just delete the train signals!