When Structural engineers design steel framed buildings, consideration is given to how to protect the steel frame against corrosion. Various measures can be employed, but the typical solution is to coat the steel frame with anti-corrosion paint, and a primer, while steel exposed to moisture or within the wall cavity will be specified as stainless steel. This type of steel is much more expensive and slightly weaker but it is corrosion resistant.
So this leads us to the question, why are railway lines, which are also made of steel, left exposed to the elements without any protection at all? It’s a good question and there are a number of reasons.
Section size and rate of corrosion. Compared with the steel used for buildings, the steel in a rail is composed of a higher quality steel alloy, which is less susceptible to corrosion. This is necessary as the rail will be subjected to much higher dynamic stresses than the steel in a building frame. A steel rail also has a thicker cross section. When the rust forms on the face of the rail it acts as a barrier which then slows the rate of corrosion. A typical steel beam used in a building might be only 6mm at its narrowest point, while a steel rail will be about 15mm wide at its narrowest point. Steel will corrode from the outer face inwards. In a non-polluted environment with no salt in the air, this rate will be approximately 0.05mm/year. It will therefore take 20 years for 1mm of steel to be compromised by rust from each face, or 2mm if both sides are exposed. If the unprotected steel section is 6mm wide one third of the section will be compromised in the 20 years, but a steel rail would only have approx 15% of its section compromised. In practice it will be less than this as the steel in the rail is more corrosion resistant. Therefore for a rail section the loss of strength from corrosion is probably negligible as compared with the loss from friction and wear from the train wheels.
Wear and tear. The top and upper side face of a rail doesn’t usually corrode because friction and wear keep it polished and free of rust. The rail company also grind the track to remove surface imperfections caused by the trains braking, if these imperfections were allowed to worsen and deepen, the high impact force of the train hitting them at high speed could cause the rail to fracture.
Coating rails. Anti-corrosion coatings are not applied to steel rail lines as the coating would hide any developing fractures or defects. Cracking of tracks from metal fatigue is taken very seriously and regular inspections are carried out to check for defects. Sometimes coatings are applied but only in very rare cases where the track will be used in very severe conditions, for instance as in India where a freight line for carrying salt ore needed to be protected from the corrosive salt falling on to the line.
Replacing rails. Different rails are replaced at different time intervals; it depends on the weight of the trains passing over them, the frequency of the trains and the location of the rails i.e. on bends, on straights or in tunnels. Rails used on a curved section of track are subjected to much higher wear than rails on straight sections. In general rails on heavily used section of track could be replaced every 15 to 20 years, with wear being the reason for replacement rather than corrosion. The rails are usually taken up and reused in shunting yards or lightly trafficked sections of track where they would be subjected to less stress.
So to summarise, rails are replaced as a result of wear from use, before they need to be replaced due to metal corrosion. Corrosion isn’t an issue because it has less of an impact on the relatively massive rail section, when compared to say the thin sheets of steel used in the body of a car. It is also slowed by the quality of the steel used in the rail and by the protective layer of rust that develops initially.