This article considers the questions of mathematical modelling of the technology of disassembling and assembling of trains at marshalling yards in order to determine the optimal sequence for the disassembling of trains from the hump. At present, the question of increasing the calculations accuracy for shunting operation arrangement by mathematical modelling taking into account local conditions is particularly acute. Freight trains arrive at the marshalling yard for processing, and they are processed according to a specific technological schedule. There are more than 10 of such technological schedules, they are very diverse and, they also have different times and their processing order. They depend on the category of train: empty or loaded, arrived from abroad or sent abroad, is there a reforwarding of consignment or not. All these local conditions should be taken into account in the mathematical model. Integration of this model into the automated working station of the shunting station operator allows detecting bottlenecks in operation, planning and making the optimal technological decision – which freight train should be first broken down from the gravity hump. In the future, it is planned to use this mathematical model for simulation modelling of the marshalling yard operation. To solve this problem, a mathematical model of the technological process has been developed, which takes into account the features of disassembling and assembling, the amount of work, technical equipment and the uneven arrival of wagon traffic volume to the station. The proposed model is dynamic and is based on a discrete scheduling theory. Using a mathematical model, it is possible to calculate performance indications for the forecast period using real-time input data.