India's deadliest train crash in more than two decades was caused by an error in electronic signals that sent a train on to the wrong tracks.