Pakistani officials say militants have attacked a passenger train in the southwestern Balochistan province.