Answer
A graph is
shown here in case when a collision is just
avoided (x along the vertical axis is in meters and t
along the horizontal axis is in seconds).
Work Step by Step
A graph is
shown here in case when a collision is just
avoided (x along the vertical axis is in meters and t
along the horizontal axis is in seconds). The top
(straight) line shows the motion of the locomotive
and the bottom curve shows the motion of the
passenger train.
The other case (where the collision is not quite
avoided) would be similar except that the slope of
the bottom curve would be greater than that of the
top line at the point where they meet.