The age of your Mazda, I would find a good lid from a salvage yard and have it painted.
I would make sure, if you are going to keep the car, that they apply the rust inhibitor into the cavatities of the trunk lid, and this is done after paint work is finished.
For a bodyshop to pull loose the flange (hope that it is not totally rusted through the flange) clean, apply acid etch/sealer primer, after refitting the flange, prep, sand, apply a base clear, expensive.
A good used lid for $200 would be less than the labor to repair yours. Then the paint process cost will vary by shops, but I would believe they can prep, paint and install the replacement for no more than another $200.
Application of the rust inhibitor, one that meets all specs and is the one that I-CAR recommends as well as Ford (by the way, the Chrysler MoPar rust inhibitor and undercoating is the same as the
Ford MotorCraft, made by ValuGard), should be aprox another $50 to $75.
If you are not going to keep the car for more than another year, just go the cheapest way you can and trade or sell it to some poor soul before things get bad.
The concern you have, if you were to closely inspect the bottom flanges on the doors, around the wheel openings, etc, is most likely going to be there, just not as bad yet.
Sorry, no easy way out of this for you.
Grumpy
PS. 3M's product, which most shops will tell you they will use, is not approved by most car companies, nor does it meet the spec's of the industry, so make sure they apply a product that is really going to protect and stop rust.