Ventilate the bathroom by opening doors and windows and turning on the fan, particularly after showers. Mildew is the worst culprit of dirty grout, and it grows best in moist, still air. Save yourself a lot of work by simply keeping your bathroom dry and breezy.
Put a small amount of rubbing alcohol, grain alcohol or vodka in a spray bottle.
After every shower, dry the grout with a towel. Then, spray the grout with the alcohol. Allow it to air dry. This will kill the mildew growing on the grout.
Consider buying an electronic grout cleaner (see Resources). These cleaners use high-speed, moving brushes, often combined with high pressure water spray, to clean grout more efficiently. All of these cleaners work in slightly different ways, so follow the instructions for proper use.
Use a grout cleaner with sodium percarbonate or sodium perborate, such as Oxiclean. Mix it with in the proportions indicated on the package, and scrub the dirty grout with a sponge dipped in the solution at least once a week. The Oxiclean should whiten old, discolored grout.