We extend the model predictive control (MPC) framework, which is a very popular controller design method in the process industry, to transfer coordination in railway systems. In fact, the proposed approach can also be used for other systems with both hard and soft synchronization constraints, such as logistic operations. The main aim of the control is to recover from delays in an optimal way by breaking connections (at a cost). In general, the MPC control design problem for railway systems leads to a nonlinear non-convex optimization problem. We show that the optimal MPC strategy can also be computed using an extended linear complementarity problem. Furthermore, we present an extension with an extra degree of freedom to recover from delays by letting some trains run faster than usual (again at a cost). The resulting extended MPC railway problem can also be solved using an extended linear complementarity problem.