A commuter train heading towards Dinajpur railway station derailed after crashing into a truck at a rail crossing in Parbatipur upazila amid heavy fog in the early hours of Wednesday.