Replacing the trim may be your only fix. Solar heat through the skylight could be softening and stretching the plastic, and may be more of a culprit than moisture, though water getting behind the trim and heated by the sun is likely also. You may be able to use screws to pull back in and square up the bowed section(s), then cover the screw heads with button caps; just know what you're screwing into.