I still don't know why the train drivers don't have a simple data: The distance to the train that is next in in that railway in its direction. With this information, that accident will have never happened.
If it was so easy then this never would have happened.
There's like 100s location data on each train, do they not just have a map of where all nearby trains are.
General case, it's not that simple. Say there's another train a mile ahead of you...but it's on a siding. To compute the effective distance, you'll need to know the positions of the switches connecting the main line to that siding. And switch positions can change far faster than you can stop, even if the other train doesn't move.
Signalling systems are never simple.
The LZB system, which broke down, had the data you describe. It knows when trains pass over fixed sensors so it computes where they are, and sends data packets to specific trains informing them their current speed limit, and the next, and how far away that is. If the driver won't slow down, the train will.
When LZB broke down, they had to switch to their other system, BSL (fixed block signalling: https://en.wikipedia.org/wiki/Automatic_block_signaling). You can then know the distance to the next block, and if it's occupied or not, but not where the train is inside the block. You can only guess.
In the next few days we'll likely find out if the control centre also fucked up the block signals...