Why not instead of a speed limit, have a wall that goes up (like the concrete wall doors you can put between walls, that automatically go down when you walk into them), when a train is coming? So that you can't walk through the path when there is a train coming. Perhaps a signal that closes the gate so you can't go through until the back of the train has passed the next signal that opens the gate again.
This would be safer than slowing down trains, it keeps your network running optimally at all times instead of slowing down trains uselessly at all locations even if you aren't around.