JAKARTA, Indonesia—Indonesian officials are scrambling to find a solution to the latest dangerous trend in Jakarta: people who roam the city's railway tracks looking for free "electric therapy."

As many as several dozen people per day intentionally try to electrocute themselves along the rails, according to local media reports, because they believe it can cure all kinds of diseases, from diabetes to high-blood pressure to insomnia. When trains approach, people briefly step aside but rush back quickly into a sleeping position...