The consequences of disruptions in railway traffic are the primary cause of passengers' dissatisfaction. Hence, appropriate dispatching decisions are necessary (e.g., by assigning the order of trains), given the numerous restrictions of traffic nature. The latter is perceived as an NPhard problem. This paper outlines QUBO (quadratic unconstrained binary optimization) and HOBO (higher-order binary optimization) representations for dispatching problems of railway traffic management. Specifically, we consider minimal span between trains, minimal stay on stations, station/track occupation, and rolling stock circulation. The main result is the hybrid algorithm to deal with disturbances in rail traffic on single-, double-and multi-track lines; the demonstrative model illustrates the issue briefly. This algorithm can solve railway dispatching problems using the quantum annealer or any other QUBO-based optimization device.