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

![\bf \begin{cases} \boxed{400}=rt\implies \cfrac{400}{r}=t\\\\ --------------------------\\\\ 160=r\left[ \cfrac{2}{5}(11-t) \right]\implies 160=r\left[ \cfrac{2}{5}\left(11-\cfrac{400}{r}\right) \right]\\\\ 240=(r-20)\left[ \cfrac{3}{5}(11-t) \right]\implies 240=(r-20)\left[ \cfrac{3}{5}\left(11-\cfrac{400}{r}\right) \right]\\\\ ----------------------------\\\\ 160+240=r\left[ \cfrac{2}{5}\left(11-\cfrac{400}{r}\right) \right]+240=(r-20)\left[ \cfrac{3}{5}\left(11-\cfrac{400}{r}\right) \right] \end{cases}](https://img.qammunity.org/2018/formulas/mathematics/college/vv08b9bwty47s7czlxw12sasr9ta4ucplh.png)
![\bf \boxed{400}=400\qquad meaning\\\\ 400=r\left[ \cfrac{2}{5}\left(11-\cfrac{400}{r}\right) \right]+240=(r-20)\left[ \cfrac{3}{5}\left(11-\cfrac{400}{r}\right) \right] \\\\\\ \textit{let us, multiply, both sides by 5, and distribute} \\\\\\ 2000=[22r-800]+\left[ 33r-1860+\cfrac{24000}{r} \right] \\\\\\ 2000=55r-2660+\cfrac{24000}{r}\implies 0=55r-4660+\cfrac{24000}{r} \\\\\\ \textit{let's multiply both sides by](https://img.qammunity.org/2018/formulas/mathematics/college/dbouryisqv7tkbabe7w3vhhzlh3rqitx4h.png)
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