Up to now, we know the train had too many cars (though it might not be an actual norm), the cars containing oil were not proper tankers and were considered fragile cars (could have delayed the fires and explosion a little) and it seems the train didn't have good handbrakes for when air brakes were defective or stopped working, like in this case.
They were inspected a few days before though and inspectors didn't see any problem.