For this type of question, you have to assign variables to your unknown values. Say, let
x be the speed of the fast train and
y be the speed of the slower train.
The time taken for the fast train to complete the journey is given by
by the formula
The time for the slower train to complete the same journey will be
Now, the time for the faster train is 3 hours less than that of the slower train, so,
Now, you're given that the speed y is 10km/h less than x, so you have another equation;
Now, replace that in your first equation and solve for x, the speed of the fast train. To fint the speed of the slow train, use your second equation and use the value of x you just obtained.
Hope it helped! :)