The pair escaped unhurt by moving into a pit beneath the track as a train passed over them.