Does the rear side have a vinyl insert? If so... Pull it out from the bottom. This should expose the heads of screws which have pulled away from the body. You can try to rescrew them, or try longer screws. Most likely the best way will be to redrill the screws into new holes away from the existing ones.
If it has the screws I'm talking about, the right way to do this includes getting some putty tape and applying it under the trim piece. Afterwards, it still would make sense to use some Proflex RV caulk or similar product on the upward facing lip of the trim piece.
In a pinch for now, buy some GOOD foil HVAC tape. It is great stuff. You can tape the edge into place with it, and maybe a dab of caulk on the top edge of the tape where it starts.
A mobile RV repair service could probably fix you up in 15 minutes.