The train was heading from the port city of Karachi to Lahore when the majority of its cars slipped off the rails near the town of Mehrabpur in Sindh province .