I am still working on a block signal. It is a delay device.
You need a block signal, insulating pins,ctc and 153c lock ons. HERE go to basic O27 manual, and look at Blocks
Another is using AC but have the engines run on DC . It would require engine modifications. It doesn't help if you own more than two.
For more info Google Block signal.
This is the old school method. DCC is multi engine control.
The trick is isolated sections and train detection. You need the 153c contact( for tubular track), block signal and insulating pins. I have two loops that I am planning on doing this. I have to look for hardware.
...and finally, you could just put 'em both on the line and use turnouts to keep them from running into each other. Turnouts are "Y" shaped tracks with switches that allow you to choose which direction the train will go when it passes thru the "Y". Send one train straight ahead and then hit the switch and send the other in a different direction. You then use a second turnout to bring them back together. Sort of like an "8", where you can choose to send one train onto the top loop and the other to the bottom, then have them both return. This would be the most primitive, low-tech solution, short of letting the faster one ram the slower one and then re-railing them. *L*