A train from the northern Serbian city of Subotica derailed on its way to Szeged across the border in Hungary on Thursday.