to repair it correctly will involve "removing" that section of the roof covering ( the
TPO or EPDM on the top ) and replacing the damaged wood. Some would say you would need to replace the entire roof covering, but I would not do so. I would cut and peel back, replace wood, then replace the roof material that was cut back. Seal the edges of the roof material with eternabond tape, and recaulk with your choice of polyurethane based caulk ( proflex, dicor, etc ). Check every inch of caulking on the entire trailer and recaulk as needed. It sounds like quite a bit of water got in over a period of time, so I would guess there are numerous breaches in the caulking. This all sounds daunting, but it's actually fairly simple if you are handy.