let the speed of the faster train be v1, the speed of the slower train be v2, the time taken for the faster train to go 4km to be T, and the distance travelled by the faster train in 900 seconds (15 min) be D.
from the first piece of info:
the slower train takes 15 seconds longer to cover 4km.
therefore,
v1 = 4000/T, and
v2 = 4000/(T+15)
so T = 4000/v1, and T = 4000/v2 - 15
eliminating T, we get:
4000/v1 = 4000/v2 -15
4000/v2 - 4000/v1 = 15
1/v2 - 1/v1 = 3/800
(v1 - v2)/v1v2 = 3/800 .....(A)
now from the second piece of info:
it travels 1km less than the faster one in 15 minutes
therefore,
v1 = D/900
v2 = (D - 1000)/900
so
D = 900v1
D = 900v2 + 1000
eliminating D,
900v1 = 900v2 + 1000
900v1 - 900v2 = 1000
therefore,
v1 - v2 = 10/9 ...(B)
subbing (B) into (A),
(10/9)/v1v2 = 3/800
v1v2 = (10/9)/(3/800)
v1v2 = 8000/27
but from (B), v2 = v1 - 10/9
therefore,
v1(v1 - 10/9) = 8000/27
v1^2 - (10/9)v1 - (8000/27) = 0
so
27v1^2 - 30v1 - 8000 = 0
if you solve this quadratic for v1, you will get:
v1 = 17.77 m/s, which is the answer (more accurately 17 7/9 m/s)
(ignore the negative root of the quadratic equation since speed is defined to be positive)