Let the slower train's velocity be x-21
Let the faster train's velocity be x
We know that the approach speed is the sum of both speeds, so x+x -21= 2x-21.
The approach rate is given by Distance/time = 471/3 = 157mpH
x+x-21=157
2x=157+21
2x=178
x=89mph
The slower train is travelling 89-21 = 68mph
The faster train is travelling 89mph.