That shouldn't happen under normal circumstances. That's whole idea behind railway signals.
Rail segments (blocks) are supposed to be automatically locked off while a train is on that segment of track. No two trains can be on the same block at the same time. If a train stops, the signal guarding that block will remain red, ordering the next train to stop before it gets anywhere close.
Rail segments (blocks) are supposed to be automatically locked off while a train is on that segment of track. No two trains can be on the same block at the same time. If a train stops, the signal guarding that block will remain red, ordering the next train to stop before it gets anywhere close.