Abstract The rails at the transition between a bridge or subgrade and a tunnel tend to creep longitudinally because of a temperature gradient on the rail, which can cause irregularity in the track. The longitudinal temperature distribution along the rail and the longitudinal resistance of the fasteners are the main influences on rail creep. In this paper, the linear and nonlinear models of longitudinal temperature distribution on rails and the longitudinal resistance of fasteners are tested for their accuracy in predicting rail creep. By researching the rail at the temperature-transition zone, differential equations for the longitudinal displacement and force of the rail are established. To predict the changes that a rail will experience in a temperature-transition zone, expressions for the longitudinal displacement and force are derived from these differential equations. The derived calculation scheme is tested for three conditions: linear models of both rail temperature and longitudinal resistance, linear rail temperature and nonlinear resistance, and nonlinear models of both rail temperature and displacement. The maximum longitudinal rail displacement and the maximum longitudinal additional force in all three conditions are compared to reveal the influence of the maximum temperature force gradient multiple and the maximum fastener resistance on longitudinal displacement.