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.
Remove the headliner.
Remove the nuts.
Pull the roof rack upward, then remove the roof rack from the roof.