Rate * Time = Distance

The first ship leaves an hour before the second so it has an hour head start

The equation for the first ship should be 20 * ( t + 1 ) = Distance

The second ship will have an equation like 25 * t = Distance

We can find the time at which both ships are at the same Distance by setting the equations equal to each other

20 * ( t + 1 ) = 25 * t

20*t + 20 = 25*t subtract 20t from both sides and we have 20 = 5t finally divide both sides by 5 and get t = 4

Plug 4 back into either equation and you will see that at 100 miles out they are together

Almost forgot, in relation to the first ship, the second will over take it in 5 hours (remember (t + 1))