At first we need to make some clarifications: the motion is uniform accelerated and distance for both trains is the same. Than gives a=constant, d1=d2=d; let’s denote t1 as time of the first train and t2 as time of the second one.
For the first train we can write d= (t1/2)(80+40)=60 t1, then t1=d/60; as for its halfway velocity we can state that the velocity V1=80 km/s, as during halftime the second train covers more than its halfway.
For the second train, as it moves uniform accelerated d=V(0)t + at^2/2 where V(0)=80 km/h ,
a=(40-80)/t2=-40/t2; at the same time we can use other kinematic equation Vfin^2 – Vin^2=2aD for D=d or
40 ^2 – 80^2=2ad= 2d(40-80)/t2 , and then after simplifying (40+80)=2d/t2; hence t2=2d/120=d/60
Therefore, t2= t1=t= d/60
Now, try to find V2 at halfway. Again use kinematic equation
Vfin^2 – Vin^2=2aD for D=d/2, that is (V2)^2 -80^2=2a(d/2)=ad and using a=-40/t2 and t= d/60 that were found in previous steps, we can write (V2)^2=80^2 -(40*60); hence, V2<80, that is, V2< V1