IF you can live with the "splice" look, you can use an angle grinder and cut out the rail 4 inches from the top, take home to a vice and straighten the rail as best as possible then put a splicer which is nothing more than a SS connector (
sold in most
boat supply stores) at the top and at the bottom-- instead of the set screws drill all the way through the splicers on both sides of each break with 17/64 or 9/32 inch drill then put in 1/4 inch SS pop rivets and it will be amazingly sturdy- fairly flush and not easy to see