WARNING: This page is about a different car, the 2003 Mazda Protege5 and 2003 Mazda Protege. However, it is still accessible from the selected car via links, so may be relevant.
Pull the front edge and rear edge of the roof molding up (1).
Slide the roof molding rearward, then remove it (2).