Derailment throws railway traffic out of gear