For decades b/4 any command, we would run two trains the same track in either the same way or opposite directions.
For the same direction simply provide several isolated blocks with a S.P.S.T. toggle switch and just kill the power to the faster engine when it got too close to the slower engine.
For conventional 3 rail set the engines for forward only.
To run in the opposite directions you need at least one passing sidding. Just park one train and let the other one go out the same switch the previous running engine came in.
Dallee Electeronics sells gizmos that will run this automaticly with conventional engines.
I built an 0n30 display layout with two independent loops, each with one passing tracking. We set four entry level conventionl Bachman trains on the layout, Two trains on each loop running in opposite directions. The switch controls and siding blocks were all Dallee automated. The trains ran all day unattended without incident.
If you think you can, you will. If you think you can not, you never will.