Purpose: Mathematical model for studying the process of soil freezing given moisture migration is developed. Numerical modeling of temperature mode of railway subgrade at non-stationary pro-cess in cold climate conditions is performed. Methods: Numerical implementation of the model is performed by mathematical module processing in COMSOL Multiphysics program, which’s based on partial differential equations (PDE), with finite element method. The model reliability is con-firmed by the comparison with previous experimental data and the results of simulation by other authors. Results: Calculation results on the developed model basis show the best correlation with experimental data in comparison with the results for other models. Calculation example and calcu-lation results for subgrade temperature mode in freezing-thawing fifth cycle are presented. The analysis of soil freezing depth change and soil temperature fluctuation change by depth by fifth year are carried out. Practical significance: The developed mathematical model makes it possible to predict soil freezing depth, taking into account moisture migration, including freezing and thawing depth changes caused by climate warming. The developed model can be used both, to study the mechanism of subgrade temperature mode distribution at freezing and thawing, and to improve subgrade construction for to protect it from soil frost heaving.