You don't give any detail about what the surface is so I'm going to assume that it can be painted.
First you have to kill the mildew with a solution of water and Chlorine Bleach, a mixture of 2 parts water to 1 part Bleach should do the trick. Make sure the surface is well cleaned and rinsed, any residue will effect the adhesion of the paint.
Any loose paint should be removed and the surface sanded to be sure of adhesion. Spot prime any bare surface with a quality oil primer, KILZ or CoverStain works well. Then give it TWO coats of Zinnser's "PermaWhite" paint. If this is exposed to the outside, then use the exterior grade of PermaWhite.
That should solve the problem on a very permanent basis.