It looks like the court ruled that another "law of this state" -- one authorizing cities to protect their buildings -- 'provides otherwise' and allows cities to prohibit firearms in their buildings: "But according to the state law cited by Karie Boylan, a Livonia lawyer retained by the city, local municipalities "can enact and enforce ordinances and resolutions for the care, protection, control and management" of city-owned buildings."
If that's what happened, then I don't think winning on appeal is such a slam dunk. Of course, that begs the question of whether it's Constitutional or not; but it'll be the preemption statute, not the 2nd Amendment, that'll be argued on appeal, and there's a pretty good argument that the Ferndale ordinance passes muster under the preemption statute because of the "except as otherwise provided by state law" language.
OTOH, I've been wrong before.
You've picked up a fine point/distinction of law. A specific statute trumps a general statute. In other words, the city can pass laws under their power to protect, unless it conflicts with a specific state law that says otherwise (the CCW law). This is exactly such a case.