There are dozens of methods used to clean the rails in the garden. There are track-cleaning locomotives, track-cleaning cars, polishing wheels you can fit to the underside of a truck, blocks, poles with pads on the end—enough innovation to make a mousetrap inventor think his job is simple. These can be broken down into “manual” and “automatic” devices.
Probably the most common tool used to manually clean the track is a drywall sander (shown above). Instead of a piece of drywall sandpaper on the end (which is pretty coarse by track-polishing standards), most people use a piece of green Scotch-Brite scouring pad. If you’ve done dishes, you’re familiar with this stuff and know it does a good job of cutting through dried-on food. It’s equally adept at cutting through dirt and other deposits but it’s soft enough that it doesn’t scrape the material while it’s doing its job, so the rails end up shiny and smooth.
There are also rubberized abrasive blocks that work similarly. They are essentially blocks of super-fine sandpaper that likewise polish the rails without scouring them. Try to stay away from steel wool (especially with power applied to the rails while doing so). The steel particles fall between the rails and can get picked up by the magnets in the motors on the locomotives.
In terms of automatic systems, LGB makes a track-cleaning locomotive that has an abrasive rubber pad on a pair of big wheels in the front. These spin about twice as fast as the locomotive moves, polishing the rails as it goes. It’s designed to be run around the railroad periodically to keep the rails clean, then put away. PIKO America makes a battery-operated track-cleaning locomotive they call a Clean Machine with a non-scratch cleaning pad mounted on the underside.
There are also myriad track-cleaning cars available that use everything from Masonite pads to paint rollers loaded with various cleaning fluids to keep the rails clean. Some of these cars are discreet, designed with mechanisms hidden under car or caboose so you don’t see them doing their job as the train rolls around the track. Others are purely functional tools whose form has little resemblance to anything that ever rode the rails.
Environmental factors alone are too variable to say any one system would work universally. If there was one magic bullet, there wouldn’t be 100 not-so-magic ones vying for the title. However you do it, though, and however often you have to do it, it’s critical that track cleaning be done if you expect reliable operation.