If this riddle is for kids it gave me a headache !!
well, if i was them i would start digging under the train track, because if either of them gets close enough to the train thats game over
so thats my answer....dig under the train, or somehow throw their smartphone at the conductor for him to slow the train down so they can pass
Sorry that is not the correct answer as it will take to much time to dig under the train!
But good try!