You have some choices, depending on how rotted the interior wood is.
As for the replacement wood, use PT (pressure treated) so as to resist future rot as moisture will eventually get in there again.
The bottom hinge is easier to repair as you can get to it from the inside since it is not a sealed surface, being under the seat. You can simply cut a suitable block of wood and fiberglass or epoxy it in place.
The upper hinge is more of a challenge as this area is finished on both sides. If the screw holes are enlarged but there seems to be "some" of the original wood still intact, I would first try injecting thickened epoxy into the screw holes with a syringe. Woodworkers use this trick to put glue into small spaces. Put in as much as it will take.You want to fill all the voids. But it must be thick so that it does not just drip down inside the wall. 2 applications of this may be needed. After a day of setting up drill a pilot hole in the hardened mix through one of the screw holes and install a 2" screw about half way. Then grab the extending screw with vice grips and test to determine if you can wiggle it around. If it appears to be solid, you are good to go. Then just pilot drill and install the hinge. It is WAY worth it to try this method since the alternative sucks...read on.
If it is still not solid. You need to cut open the FG and dig out the rotted wood and replace with new dry PT. It is your choice as to whether you want to go in from the outside or the inside. You can get a small fiberglassing kit which has resin, hardener and glass cloth, since you are doing a small area.
I did this to my Burro. After the repair, I painted the new FG with the closest color auto spray
paint that I could find. (some old Ford white from auto parts store). Feathered it into the gelcoat (all wax removed) with fine sandpaper then polished the whole Burro with RedMax pro. It looks amazingly good. The polish and the curved surfaces hides the slight color mismatch.
When reinstalling the hinges, regardless of repair method, be sure to set the hinge in butyl tape to prevent water from leaking in again through the screw holes!
The Burro hinge itself is a Polar hinge originally designed for commercial freezers. The hinge itself should outlast the trailer.
Good luck,
Rick