Reordering and local rerouting strategies to manage train traffic in real time