Assuming the man only just escapes at each end, then the train must be half a tunnel length away from the start of the tunnel and travelling at 24 mph.
If the man runs towards the train, he travels a quarter of the tunnel length at 12 mph, and the train travels twice that distance at 24 mph. They meet at the entrance.
If the man runs on through the tunnel, he runs three-quarters of a tunnel length at 12 mph and the train travels one and a half tunnel lengths at 24 mph. They meet at the exit.