This one needed a lot of patience, but Josh cracked it.
Train A reverses and allows Train B to pull forward.
Train B reverses up the siding and leaves carriages B3 and B 4 there.
Train B then pulls back on the main line and reverses.
Engine A then goes into the siding and reverses with carriages B3 and B4, taking them on the main line.
Engine B with carriage B1 and B2 then pulls forward far enough so it can reverse on to the siding.
Engine A then goes forward across the siding pushing carriages B3 and B4 in front and pulling A1, A2, A3 and A4 behind.
Engine B then pulls out of the siding with carriages B1 and B2 and goes forwards down the track.
Engine A then reverses, pushes carriages B3 and B4 into the siding, leaves them there, reverses back on the main rack and pulls forward.
Engine B then reverses into the siding with carriages B1 and B2 and picks up carriages B3 and B4.