This is clever — in 1895, Henry Latimer Simmons invented ramp-shaped railroad cars:

“When one train meets or overtakes another train, one train will run up the rails carried by the other train, and will run along the rails and descend onto the rails at the other end of the lower train.”

See? With good design, everybody wins.