Set the points to the ore unloader & then reverse in.

For whatever reason, the wagons are prone to derailing as you perform this manouver.

Staying below 5mph offers the best chance to avoid this circumstance but is not foolproof, so it's a good idea to Press F2 & save your game so you don't lose your progress this close to the end.