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 on the tracks to feel electrical currents they believe will cure their ailments.

Residents say the unorthodox—and dangerous—practice started with a local rumor about a man who tried to kill himself by lying on the tracks. He was fed up after suffering paralysis from a stroke and medical treatment failed to cure his symptoms. He allegedly decided that being crushed by a train would be better than continuing his misery. But while lying on the tracks, he suddenly felt cured, according to the hearsay. It's unclear whether any elements of the story were true.

As word of the supposed miracle spread, train tracks in slum areas in northern Jakarta became trendy as impromptu clinics. Until recently, more than 50 people would show up at the city's Rawa Buaya tracks every day. The numbers have dropped recently, since police and the state-run railroad erected a warning sign, but some people still come, convinced the tracks can cure them.

There is no medical or scientific evidence to support the treatment, says Murti Utami, a spokeswoman for Indonesia's Health Ministry. Officials have forbidden people to enter the site and threatened penalties of up to three months in prison or fines of $1,800, but it is difficult to police train tracks in Jakarta, which stretch out in all directions across the city, often with people living bunched up alongside.