this is a sum on relative velocity.this sum becomes easier when use the relative velocity of the fast train with respect to the slow train
velocity of fast train=115 km/hr
velocity of slow train=25 km/hr
relative velocity of fast train with respect to the slow train=115-25
=90 km/hr
=90*(5/18)m/s
=25 m/s
now,initial velocity(u)=25 m/s,final velocity(v)=0 m/s,distance(s)=100 m
v2=u2+2as
0=(25*25)+2*100*a
-200a=625
-a=625/200
-a=3.125
a=-3.125m/s
the least retardation must be 3.125 m/s