I have a few cars that derail more than others. Especially a set of double decker Williams. I found the truck axel bushings were worn away. Thus, the axels would not stay straight. Checking axel play and that trucks are oiled ensures good operation.
I also noticed a few engines and powered cars may not be totally free moving to one side. Making sure wires are slacked enough for even pull on each way keeps the cars from being pulled off in the corners.
As a note, I run 0-31.