REPORTING FROM SEOUL -- For years, transit officials on the Indonesian island of Java have tried unsuccessfully to stop daredevils and fare-jumpers from scaling the roofs of trains for a dangerous rush-hour thrill ride that kills dozens each year.

Now, it seems, authorities are on top of the situation -– with a series of rather bizarre solutions.

Last month, the state railway company began erecting catch-all contraptions that feature grapefruit-sized concrete balls swinging from frames, allowing just enough room for the train to pass by underneath, but not rooftop free-loaders.

Many of the "rail surfers" decided to quit the practice rather than risk being struck by one of the balls and knocked off the moving train, according to media in Jakarta.

Emboldened, rail officials this week are employing a second measure they hope will have equal effect in chasing away the roof riders who sometimes commandeer the roofs of trains hurtling across the main island: huge suspended brooms that whack illegal riders with a gooey goop.

Beleaguered officials say they don't want to hurt anyone, but reason they need to get tough to discourage the practice for good. In the past, they tried such solutions as spraying roof riders with paint guns, calling in sniffer dogs, and asking for help from Muslim clerics.

Officials wave off criticism that the tactics are dangerous and choose to focus on the idea that the roof surfers are stealing by taking to the roofs of trains to escape overcrowded carriages and/or the price of a ticket, or simply because it's more fun.

Officials say that dozens are killed or injured by the practice every year, falling off the train or being electrocuted by power lines above.

RELATED:

Borobudur temple in Indonesia

No tsunami threat in Southland after Indonesia earthquake

Gone? Nope -- Cameras spot monkeys believed extinct on Borneo

-- John M. Glionna

Upper photo: A train passes concrete balls known as Goal Bola-bola, or goal balls, intended to discourage train roof riders. Credit: Ulet Ifansasti / Getty Images

Lower photo: Commuters illegally riding on the roof of a train. Credit: Dita Alangkara / Associated Press