Heavily depends. I'd imagine trains and cars carry at least some flammable material to function, oil/fuel/coolant/hydraulic fluid/etc. That being said, freight is largely used for industrial shipping. It's a lot better to have something go wrong on tracks that are usually far away from most civilization and other people. I'd imagine a spill or fire on a road or in a neighborhood would be a lot worse.
I think it's a combination of crashes like this simply being so huge with so much force that there's not much you can do to protect cargo in situations like this (at least not economically). That and the fact that rail is generally the "better" option for transporting high risk/dangerous stuff. Better than having it loose near housing, on the road with other drivers, or god forbid fall out of the sky.