This problem is a comparison of how fast sound travels through different mediums. The speed of sound in iron is 5950 m/s while in air, it is 331 m/s. Given that the train is 100km away, we can use the given values to solve for the missing values:
Listening through air:
100000/331 = 302 seconds
Listening through the rails:
100000/5950 = 16.81 seconds