Same type of rub rail on my O'day and had similar damage. I can add a couple of things to the above advice.
If the base comes coiled, straighten it out ASAP. If it has retained coil shape to it, lay it out flat and straight somewhere in the sun for several days. That will help with installing it flat and straight. I had to screw mine flat to a unused dock for a few weeks of warm weather.
I replaced all of my rub rail and while I had the old off I checked the hull/deck joint screws and found many were not snug. I pulled them all out a few at a time, coated them with 3m 5200 and put them back tight.
For the base rub rail I filled the old holes with 610 Epoxy, drilled new pilot holes through base and hull joint at the same time, then installed screws coated with 3M 4200.