Thermal behavior often affects the performance of thin-walled steel structures and even becomes one of the controlling loads. Steel pipes are often used in foundation pit support. This problem of the thermal stress of steel pipes is very important. The Huhang Railway, a section of the high-speed railway from Huzhou to Hangzhou in Zhejiang Province, China, was examined in this study. In this paper, the displacement and stress in pit 358# of the Huhang Railway near the railway foundation was monitored, and a thermal coupling model was established. The temperature field distribution inside the foundation pit was calculated through solar radiation and ambient temperature, and the displacement and stress of the supporting structure and enclosure structure were calculated using the thermal expansion coefficient. The following conclusions were drawn from the comparison: (1) In addition to solar radiation, ambient radiation should also be taken into account at the same time, especially in the calculation of the substructure. (2) The temperature of the support structure was unevenly distributed, and the maximum temperature difference between the steel pipes on the east and west sides could reach from 18.9 °C up to 58.8 °C. The height angle of solar radiation was the main factor that led to this situation. (3) The difference in stress between the support structure and the enclosure structure was positively related to the change in temperature. When the temperature rose, the stress increased, and the horizontal displacement of the enclosure structure decreased, which was beneficial to the stability of the foundation pit and vice versa. (4) The thermal behavior had different effects on the stress at different depths and times, and had spatial and temporal heterogeneity. The enclosure stresses had a certain delay in response to temperature changes. The reasons for this are yet to be investigated.