Train derailments are rare, yet collisions and accidents still occur despite efforts to improve safety.