hi.......firstly, derailments with a long train of wagons...or indeed, anything.....can be down to a multitude of factors.
such as.....track?
[ie, is the track evenly laid?
how tight are the curves.....are there any S-curves....turnouts..etc....track joints....obstructions [such as the odd raised track pin].....points set the wrong way...all manner of things]
vehicles themselves....?
[wheels...particularly whether they all have even distances apart....back-to-back, etc.....run freely....bogies on coaches able to swivel freely etc]
then there are the individual vehicle weights?
much has been written on the topic of ideal weights for wagons and coaches...I suppose a couple of ounces of extra weight for an ordinary 4-wheel wagon or van...more for a coach, or long wagon...and so on.
Of course, there is also the factor of train make-up [no, not LNER lipstick]....the heaviest of wagons should have been behind the loco, graduating to lighter ones further back down your train....if lightweight wagons were at the front, then the heavier wagons further back will place pressure on the front wagons, causing them to fall off, especially on curves.
so......add a bit of weight to the wagons....stuff sold through Model Rail magasine, called ''Liquid Lead'' is quite useful for placing weight under wagon floors, inside the chassis.
Other wagon issues centre on the type and size of couplings between each vehicle....whilst I suspect nearly all modern proprietary stock will have hook-and-bar couplings of some sort, [unless modified by the owner...in which case, sorting de-railment probs is all grist for the mill].....but these couplings can vary immensely in size, flexibility of side swing, etc, between makers.....creating pressures on the wagons causing de-railments......check the various lengths of hook, for example....see which wagons cause problems with each other....on the tightest curves you have......check out also, S-curves, like those between a crossover pointwork set-up on a double track?
In this instance, settling on one particular make of coupler can help....Bachmann's are about as good as they come with this type.....indeed, I believe most of Bachmann's freight stock surpasses that sold by Hornby...apart from certain exceptions.
Also, make sure that every wheelset has the same distance apart...and spins freely.
If you are set upon creating a realistic model railway, ie have a specific prototype in mind...which you seem to have...then why not take a look at the various chassis parts from the scale kit makers, like Parkside, etc...these are sold separately, for a modest cost, and can be used to correct things like wheelbase, which the big makers can tend to gloss over...no doubt in the interests of costs......bachmann or hornby bodies can be affixed easily.....thus you are well on the way to establishing a wheel and coupling standard, as you can pick and choose, rather than simply having to accept what you are given??
so, to sum up, take a look at couplers,and weights.....especially if you think the trackage is OK