Formality: The term 铁路 is neutral in tone and can be used in both formal and informal contexts when referring to the railway infrastructure itself. However, in casual conversation about taking a trip, you are more likely to use the word for the vehicle,
火车 (huǒchē) or
高铁 (gāotiě).