How can I prevent my train from derailing?
One thing I would say from my model train experience is that shunting (pushing) is more likely to derail a train than pulling, especially at speed.

There are a few factors that influence this in models more than we see in "real life":


The force is usually transferred via the couplings rather than buffers. This means there is more chance that the force will be applied at the wrong angle, forcing the leading elements off the track
The elements are too light. In real "multiple unit" trains where the driving force is at the rear of the train, the front elements are still very heavy, which mitigates the effects of force distribution somewhat - if you can add more weight to the Locomotive build then you may have more success.


A simple confirmation of this would be to remove the Locomotive from the train and see if you get the same derailments?