Reduction of welding residual stress is very important in the railway industry, but calculating its distribution in structures is difficult because welding residual stress formation is influenced by various parameters. In this study, we developed a finite element model for simulating the repair welding process to recover a surface damaged rail, and conducted a series of parametric studies while varying the cooling rate and the duration of post weld heat treatment (PWHT) to find the best conditions for reducing welding residual stress level. This paper presents a three-dimensional model of the repair welding process considering the phase transformation effect implemented by the ABAQUS user subroutine, and the results of parametric studies with various cooling rates and PWHT durations. We found that heat treatment significantly reduced the residual stress on the upper rail by about 170 ㎫.