As soon as one train brakes, the train behind should automatically brake. The separation distance can be maintained. The problem is if the first train hits an object or derails, this might cause it to slow down faster than the brakes would have done, and the following train may not have time to stop.
What happens if the train in front is a passenger train (a passenger pulled the alarm handle) and the train behind is 30 cars loaded with coal, steel beams or diesel fuel?