You can carefully pry it up and pull it loose but it bends easily. The safest way is to remove the glass and seal and separate it. Installing it is more difficult. I have replaced a single small section with the glass in place but it was a pain.
If it was mine, I would pull the glass and seal, install the trim in the seal, put the seal in the frame, and then install the glass. Sounds like a lot of work but I can do a windshield in about 20 minutes by myself. I spent way more time than that trying to install one piece of trim into a seated seal.