As already stated too broad a question.
You need specify what era, what region and what sort of train did you have in mind?
A trains safe progress was / is controlled by signal boxes. Trains were passed from one signal box to the next. If the box further down the line could not accept the train for what ever reason the train would be held, if need be in a siding or loop until the next box could accept it.
In the past communications between signal boxes was by bell code, I don't know how the current signal boxes communicate.
When you know what area you are thinking of, so find the list of bell codes for that region. They should cover every type of train that the railway company would expect to run on their lines, as well as some specials.
Any variations would be notified by Notices to all boxes along the route.
Depending when you are thinking of, the signal boxes were also connected by telephones which may be used to sort a problem out.
Gordon A