The purpose of investigating railway safety violations is to establish the causes and/or contributing factors, develop recommendations for preventing future safety violations, and ensure safety.