You can buy epoxy grouts which don't dry porous and therefore don't provide a good strong foothold for mildew to grab onto. The reason why mildew is hard to clean off of regular cement based grouts is that these grouts are porous and the mildew grows right inside the porous surface of the grout where it's protected by the grout from being scrubbed off or washed off by a shower spray.
I own a 21 unit apartment block in Winnipeg, and I can tell you that you could probably clean the mildew off of your grout much better than you're currently expecting if you know how to clean grout properly. I would try a real good cleaning before replacing ANY grout, and then JUST REPLACE THE GROUT YOU CAN'T GET CLEAN.
To do that, proceed as follows:
1. Buy some PHOSPHORIC acid based toilet bowl cleaner. Phosphoric acid will not harm glazed ceramic tiles, but it will dissolve grout to an imperceptable extent. Also, since toilet bowl cleaners will be gelled to stick to the side of the bowl better, they will stick to ceramic tiled walls better too. Also, buy some stronger acid, like CLR cleaner or Limeaway in case you need to dissolve more grout.
2. Buy a rubber squeegee and a fairly stiff toothbrush if you don't have an old one. Get some bleach, too.
3. Also, go to your local Home Center and see if you can find a good quality ACRYLIC grout sealer. Stay away from any silicon based grout sealers. Phone any Customer Service phone number on the grout sealer to confirm with the company that it's an ACRYLIC grout sealer.
Here's what you do:
A. Paint the gelled toilet bowl cleaner onto a small area of tile with a paint brush, and then squeegee that area to redistribute the cleaner only into the grout lines. Scrub those areas with the toothbrush. That will kill the mildew and dissolve the surface of the grout whose porous surface is all plugged up with soap scum and mildew. By opening up that surface porosity, you allow the grout to wick in bleach in the next step. Rinse off with clean water and towel dry. The better you can dry the grout, the greater the capillary pressure will be in the next step, and the more successful will be your cleaning effort.
B. Now, use an artist's paint brush (or your toothbrush) to paint bleach straight out of the jug on the cleaned grout lines. Capillary pressure will draw the bleach in to kill any remaining mildew in the surface of the grout. This process takes time, and I find that sometimes I'll have to reapply the bleach every hour or two for several hours (or even leave it on overnight). The bleach will whiten the grout. Once the grout is white to your satisfaction, rinse the grout with clean water to remove the bleach from the surface. If it's not white to your satisfaction, try a stronger acid to open up the surface porosity more, rinse and apply bleach again. If you still can't get it clean, then replace that grout.
C. After rinsing off the bleach and allowing time to dry, use an artist's paint brush to apply acrylic grout sealer over that grout. Since that grout sealer is gonna stick better if it partially wicks into the porous grout, it's best to apply the grout sealer when the grout is as dry as possible. What I do is hold a 15 watt light and a small cup of grout sealer in one hand and the brush in the other. I can tell by the way light reflects off the surface I'm painting whether or not the surface is fully covered and whether the acrylic sealer is gradually being wicked into the porous grout.
D. Now, replace any grout you couldn't get clean. Allow that a minimum of 10 days to dry, and then seal it with the acrylic sealer.
By doing it this way, you put a clear plastic acrylic raincoat over your grout which the mildew can't get any foothold in. Also, the acrylic sealer will eventually erode from the shower spray, but in my 21 bathrooms, the stuff has lasted me 15 years and counting. And, once it does wear off, you can repeat the procedure and you're good for another 15 years.
Take a look at my web site at:
http://www.ilos.net/~nkelebay
Click on Suite 21, then click on the bathroom on the floor plan image map and look at the bathroom in that suite. I don't remember how long ago I tiled that bathroom, but it was a minimum of 10 years since it's got small tiles in it. (I've used 6X8 tiles for all my tiling for AT LEAST 10 years now, probably closer to 15.) There is no mildew on that bathroom or on any grout in any of my 21 bathrooms cuz of using an acrylic sealer over my grout.