A ranger unit was inspecting the route when the explosion took place about 6.30am near a mosque in the district.
There were no injuries, police said. Initial investigation showed that the blast damaged about 20 metres of track and caused the suspension of all14 trains in and out of Sungai Kolok train station. The trains now have to drop passengers before the station.
Officials are now repairing the track so that normal services can be resumed as soon as possible.