Molds and mildews are inactivated and 'liquified' by the use of 'caustics'.
I would suggest to go to a local "Tool Rental Place" and rent a portable *carpet soil extraction machine* .... but one that has an auxiliary 'furniture soil extraction' adjunct - a smaller hand held vacuum tip with built in spray nozzle.
I would first spray on a strongly caustic detergent to loosen and DISSOLVE the mildew/fungals .... spray on and let soak, then lightly scrub, and spray again.
Caution - caustics can be dangerous/destructive to skin, eyes, and lungs; therefore, you MUST wear gloves, goggles that SEAL your face/eyes, AND must wear a chemical respirator. That respirator should be the high quality consumer types used for painting, etc. and that have an integral 'dust' removal (pads) section. I would recommend to DOUBLE the normal amount of 'dust pads' normally used to help capture any caustic aerosols caused by the spraying/vacuum-extraction. 3M respirators sold in box stores are probably the best, but buy extra 'dust pads' (you can 'tape' them to the outside of the respirator 'inlet').
Spray on the caustic detergent, let soak, lightly scrub, respray/scrub let soak. It takes time for the mildew to 'dissolve'. Suggest you use a sodium silicate based detergent such as "Roll-On" or "Tuff-eNUFF" which are available in many boat supply outlets such as West Marine, etc.
THEN use the 'furniture attachment' and with water ONLY in the 'detergent tank', extract the fabric liner. Once the caustic (and mildew) is fully extracted, then add the 'usual' carpet/fabric cleaners/surfactants (usually supplied with the rental) and do one or two more extractions. These are vacuum extractions so the fabric will remain wetted for some time .... if you have a humidifier, bring it to the boat and use it to help dry out the fabric.
FWIW - the caustics will also dissolve 'boat dust' ... the zillions of dead exfoliated human skin cells that stick to 'everything' and which are the probable PRIME source of 'boat odor' when they 'rot' and turn into odor causing 'putrenes' that stink to high heavens. Caustics dissolve them.
Caution2 - Most fabrics used in boats do not contain 'cellulose' - cotton, rayon, etc. Caustics will breakdown, weaken, and partly dissolve the 'cellulose' of 'natural' fibers. I would suggest that you take a small 'snip' of the headliner from a hidden place, soak it in the caustic that you choose, and soak for a day or so; rinse, let fully dry and then examine if or not the fabric has been severely weakened .... if so ... replace the fabric with new. That 'test' would be the comparison of 'pulling apart' with your hands a sample not soaked versus a sample that has been soaked in the caustic. I would expect that even a fabric made of 5-10% cotton blend would be affected by a strong caustic detergent - severely weakened.
•Clean/soak with CAUSTICs.
•Wear eye/lung/skin protection when cleaning with caustics -- keep a large bucket of fresh water available to IMMEDIATELY wash/rinse any accidentally spilled caustic on skin/eyes etc. The danger sign is a strong 'slimy-to-the-touch' feeling that 'hurts'; if so then, IMMEDIATE and long term wash off and rinse with plain watesr.
•Use a carpet 'soil extractor' with 'furniture' attachment
•*TEST the fabric for 'weakening' by the caustic before aggressive cleaning.
To prevent the return of mildew, treat (ALL inside the boat) *unpainted* (including not varnished nor oiled surfaces 'caustics are used as paint/varnish strippers) and non-fabric surfaces with a commercial "mildew retardant" such 3M "Mildew Block" etc. If not available, then simply spritz on 'any' caustic, wipe and let dry - a modern equivalent of 'white-whashing'. 'Whitewashing' inactivates mildew spores.
Clean any and all mildew from the boat - from underside and hidden surfaces, bilge, etc. then apply anti-mildew compound (or 'whitewashing' caustic) to everything but that which is painted, varnished or is a fabric.
Avoid the use of vinegar, lemon juice and other 'acidics', as mildew THRIVES in low pH (acidic) conditions. If you use such, what isnt 'stunned/killed' will be 'fed' by the 'acids'.
Hope this helps.