This paper deals with a special case of the Vehicle Re-Scheduling Problem (VRSP) for passenger railways in case of emergencies. These emergencies arise when a service line is disturbed due to a huge and unexpected demand which exceeds the service line capacity. In order to provide a proper response to this type of emergency, an on-line optimization model based on a discrete-event simulation model is proposed to provide and support decisions about reassigning vehicles from other lines of the transport system to the disturbed line. The simulation model is based on a dynamic network loading model, a dynamic demand generation model, and a schedule-based service network. The on-line optimization model has been solved using two greedy heuristics which automatically generate near-optimal decisions about vehicle reassignments considering the total time in system for passengers as the minimization criterion. An experimental study, based on a synthetic network and the Madrid Regional Railway network, shows that the second proposed heuristic provides near-optimal reassignment decisions with short computation times compatible with real-time use.