Railway Operation Simulator can do that, you can set up line speeds and distances on tracks, power and max speed on trains, and get a service which is close to real-world performance. Very fiddly and with some limitations, but free.
https://www.railwayoperationsimulator.com/