I have a Beneteau 393 and sustained damage to the toerail a couple of years ago. It's aluminum, and quite malleable. Mine was bent up more than inboard like yours, but the outboard lip/flange lifted off of the hull/deck joint, exposing a bit of the joint.
Before you spend a lot of money, try repairing it. In my case, I first resealed the area under the bent up piece with 4200, and used a small wooden spatula (like a popsicle stick) to spread it out as necessary. Then I carefully used blocks of soft wood (pine or fir 2x3 and 2x4) and a hammer. Yup, that's right. The old fashion way. I was careful, took my time, and lo and behold you can not notice it from 15 feet away. No problems since.
Yours looks fixable. Start on the piece bent inboard and see how the metal moves. You may want to start gingerly, but might need to wack harder. I believe that as you do that, the part that is slightly lifting from the deck will go back down too. If not, you may need to attend to that area specifically too, but be careful not to cause fiberglass impact damage. You will probably be able to get it functional pretty quickly and the rest is getting to look acceptable cosmetically.