Regardless of the existence of cars, only from the perspective of team A and team B, there is symmetry, and the time and distance of team A and team B are equal respectively, thus ensuring that the total time and distance used by team A and team B are equal.
So, if the whole journey is x kilometers and A goes 1 kilometer, then
① When A got off the bus, B left (x-1)/40 * 4 = (x-1)10km.
(2) And the walking time of B is equal to that of A, so:
[x- 1-(x- 1)/ 10]/(4+50)+(x- 1)/40 = 1/4
To solve this equation:
x=7
So the ratio is 1:7.