If I did no mistake :
Let's denote c(t) and f(t), respectively, the position of the commuter train and of the freight train at time t (t in seconds, position in meters).
We can choose the origin such that c(0) = 0, and then f(0) = 94.
During the first period ( 0<t<24) :
c'(t) = 3t/4 + 6
f'(t) = t/4 + 12
according to the graphs.
By integration :
c(t) = 3t²/8 + 6t
f(t) = t²/8 + 12t + 94
Incidently, you should find, at t=12, a difference of 130 meters between the 2 trains, which is the maximum the freight train will be ahead the other train.
At t = 24, c(24) = 360 and f(24) = 454, so the freight train is still ahead.
During the second period (t>24), both velocities are constant :
c'(t) = 24
f'(t) = 18
Hence, for t>24, c(t) = 24(t-24) + c(24)
c(t) = 24t - 216
and f(t) = 18(t-24) + f(24)
f(t) = 18t + 22
So as to find out question (c), you will have to solve for t : c(t) = f(t).
24t - 216 = 18t + 22
gives you t = 238/6 ~ 39.7 sec
For question (d), just compute c(60) - f(60) :
(24*60 - 216) - (18*60 + 22) = ... = 122
The commuter train is 122 meters ahead of the freight when t=60 sec.