Speed equals distance divided by time, so speed multiplied by time equals distance, let V be speed of train, then V + 20 would be speed of truck so
(V + 20)t = 240 ; V•t = 160 [solve for t] t = 160/V substitute for t in first equation (V + 20)160/V = 240
multiply both sides by V so (V +20)160 =240V ; 160V + 3200 = 240V ; 3200 = 80V; V=40 km/hr
so truck’s speed 40 + 20 = 60 km/hr