Railway safety officials have begun an investigation into the accident .