Check out this site http://www.centerline-products.com/index.html for this system:
How the Cleaners Work
The cleaner is a weighted absorbent roller that may be moistened with any of a wide variety of cleaning fluids (or may be used without fluids). The roller is guided along the rails by the frame of the cleaning car. The roller is allowed to "float" and gravity will press it firmly onto the rails. Because there is a small amount of drag concentrated in the roller, it will be slipping (slightly) even when turning. Rail grime is absorbed into the cleaning surface of the roller and removed from the rails (not just smeared around).
The fluid that remains on the rails (before evaporation) will loosen built-up dirt from the wheels of any locomotives and cars that follow. After several passes, the rails and wheels of all rolling stock should be electrically clean and free from wheel slippage