Those rails just pop up. They're held in by like 5 or 6 clips I think. Start from the back (like in the OP's picture) and use a small flathead screwdriver. You can use the seal on the rear windshield as leverage. You'll probably break the first clip or 2 but after you get the second clip up you can slide the rail back...it'll just come off.

The seals are glued in but they're easy to take off and replace too. I didn't even reglue mine. They just slid back in.

You could also vinyl the trim. I didn't have that peeling but I vinyled mine matte black. Just make sure you sand the paint flat otherwise the chipping will show through.

Did you by chance do this? I just got my 325i and the drivers side roof trim is chipped really bad. The passenger side looks fine. If it is easy to pull off I may just remove sand and paint it tomorrow. It is really bugging me. Thanks in advance for an help.