“Human error and track defects are two of the biggest causes of derailments, for example. In cases involving hazardous chemicals, equipment failures have also played a role in the past. These issues, broadly, may be compounded by staffing cuts railroads have made in recent years and their resistance to more costly equipment upgrades.”
https://www.vox.com/policy/2023/3/30/23663182/minnesota-train-derailment-east-palestine-hazardous-chemicals