This paper is dedicated to the simulation of the process of rolling a railway wheel over a rail joint using the finite-element method. The possibility of dent generation due to this process is demonstrated. The dependence of maximum equivalent stress in the contact zone of the wheel-rail system versus time during the rolling over the rail joint has been plotted. The dependence of maximum equivalent stress on the gap between the rails has also been obtained. It has been shown that accurate checking of the wheel- rolling surface and control of the value of the gap between the rails on all parts of the railway is necessary for reducing the possibility of dent generation.