So hmmm the train goes one way, from A to B, 400 km, takes hmm say "t" time, it goes at rate "r"
then it comes back around, at rate "r", goes 2/5 of the way, then it drops its speed to "r - 20", or 20km less per hour
that means, the rest of the way on the B to A way, it's only running at r-20, now, a "whole" is 1, if we take 2/5 then we're left with 3/5, so 3/5 of the way from B to A, it went r-20 fast
since the whole trip, A to B and B to A, took 11hrs total, then if from A to B, it took "t" time, from B to A, it took 11-t long
2/5 of 400 is 160km, and 2/5 of 11-t is 2/5(11-t)
now
3/5 of 400 is well, 240 :), and 3/5 of 11-t is 3/5(11-t)
if we add 160 + 240, is 400, since 2/5 + 3/5 is 5/5 or 1whole
so, if we add 2/5(11-t) + 3/5(11-t), is how long it took on the way from B to A
so.. we that in mind
now, if you run the quadratic formula on that quadratic, you'd get two values, one is a low 5.5 or 5.5 km/h, which is very unlikely the train was going that fast =), and you'd get a feasible 79.2189, or about 79km/h