Derailed Dalwhinnie train was wrongly diverted in incident that shut the line for almost a week