If I were to ask most model railroaders what is the most important part of the track, they would reply "the rails." This is pretty much a no-brainer, without the rails the train wouldn't be able to be controlled or "stay on track." But if I were to ask modelers what is the most important part of a model train locomotive, I would get a couple of different answers. The engine, I'm sure, would be the number one guess; without it the train can't go anywhere. And because of this, when modelers have trouble with how their train is running, the first thing they think is that there is something wrong with the engine. I would like to say, there is another, overlooked, part of the locomotive that is very important. It's the wheels. You've heard the expression, "where the rubber meets the road," well in model railroading it's, "where the wheels meet the rails." When operating your trains, there is an electrical current that travels through the rails. This current is picked up by the wheels of the locomotive and is transferred to the motor where all the locomotives functions are carried out. Over time, dirt, dust, and oxidation will build up on the track and locomotive wheels. This causes the connection between the wheels and rails to become weaker and the locomotive draws less power. With less power, the motor can't perform to its full potential and therefore causes problems. This is evident in the train slowing down in certain areas of the track, or the sound sounding muffled or cracked. This is why it is important to clean and maintain your railroad track and wheels on a regular basis. If you have brass rail, you will find that it is more of a pain than nickel silver track. The oxide on brass rails is a big hindrance on conductivity, whereas, oxide on nickel silver is still able to conduct electricity. Steel rail is even worse yet, but is not really used anymore, and weathered rail can be a problem due to it being pre-blackened by chemicals.
Some modelers use abrasive cleaning blocks to clean their tracks. This is a small block that you run across the tops of the rails, and it will clear away any dirt and grime build up. I don't recommend this method, because the abrasive block could leave small scratches on the rails causing dirt to get in those scratches and making it harder to clean the next time. Modelers that use the abrasive block feel dirt is going to get in there anyway.
Oil Based Solutions
It's very important to use the right kind of oil for this. Do not use any type of automotive oil as it is a slippery type of oil and will be almost impossible to completely remove from the rails. Hair clipper oil and sewing machine oil are best, because they are a thinner type of oil made specifically for small machines. The oil will also leave a thin layer on the rails that will help prevent them from oxidizing. This is especially useful for those of you who have layouts in a salt air, or laundry room type of atmosphere. I like this method because of the protection it gives, but this does come with a warning. For those modelers that have inclines on their layout, the thin layer of oil on the tracks will limit the amount of traction between the wheels and rail, therefore limiting the number of cars you will be able to pull up an incline. This is just something to keep in mind.
These seem to be the most efficient, there are a lot to choose from, but I recommend going with one that is non-toxic and non-flammable. You don't want dangerous fumes coming from your track, and you definitely don't want anything flammable mixed with electricity. Goo Gone and Aero-Locomotive Works Fluid are some good ones. These solvents are good enough to break up all the crud on the track and wipe away clean without leaving a film or residue. I recommend this method as well, as these solvents do what they are supposed to, without causing damage.
If you have an extensive layout, and cleaning the track by hand will take you an extremely long time, perhaps you would be interested in cleaning cars. These are rolling stock cars that are designed specifically for the purpose of cleaning you tracks. Manufacturers usually make them as boxcars or tank cars that hold the included cleaning fluid, and have some type of sponge on the bottom to wipe along the track. You hook the cleaning car up to the end of your train or locomotive, and run it around your layout a couple of times. If you have any tunnels that would be hard to clean using the above methods, running a cleaning car through would be great for cleaning these rails. These are just some of the main methods used to clean train tracks, and each have their pros and cons. This is a subject that will always be discussed among railroaders, because we all have to deal with it at some point or another. Try out these methods, and talk to other railroaders to see what they do. Eventually you will choose one that fits you, or you may come up with a new method of your own. Happy railroading!