They degrade at the speed of plot.
There's no "rule" on this. As you spelunk Golarion's various ancient ruins, you'll find that their magical properties have decayed to one degree or another, based on age, how magicky they were in the first place, and so on.
For example, the fallen Shory city of Ulduvai in Crucible of Chaos certainly can't fly any more and its defenses aren't per se operable, but there's plenty of stuff still merrily giving off sparks or gas or whatnot. So it's not like the defenses are working in general (though specific ones inside some more intact locations are), but it's still "magical" to a degree.
Azlant era ruins, like in From Shore To Sea, still have plenty of magical stuff going on - in that case ripped-off tops of towers swooshing around in the air and intelligent will-o-the-wisp powered floating streetlights. Or the city of Saventh-Yi, from the Serpent's Skull Adventure Path. But not every place the Azlanti built a fort is still alive and zapping today or else there's be more than a fistful of them in the Inner Sea region, yeah?
But there's also plenty of places that are just ruins that don't still have lots of magical effects about them. It's like if you asked "how much are physical ruins still there over time?" Well, Roman ruins, some are still there today, most places after the fall of the Roman empire for centuries are nothing more than stains on the ground. Different technologies, different values, different circumstances. Note that everything built in the Age of Enthronement is objectively crappy compared to the works of those ancient ages; you're talking 2000 years as being about when Taldor took over the frontier and called it Cheliax.
I'm addressing magical fortifications not magical items because they're basically completely different in the rules and fortifications is your problem at hand (not that there are rules for magic item degradation either, but in published adventures you find ones that are super old and then you can also find degraded and broken ones.)
And it's not super relevant to finding them anyway.
The Real Flaw In Your Plan
All those really magical locations above are still hard to find. Why? Because they're up in mountains or out in jungles or underground or whatnot. If your plan to find them is "detect magic," you really need to go read the spell description again. "60 foot range, blocked by 3 feet of dirt or 1 foot of stone" is what I see.
You pretty much need to have found the fortress to be able to use detect magic on it!
And even if they had magical defenses it doesn't mean every bit of the ruin is magical. If they had magical cannons, the towers they were in were just stone. If they were "magically hardened stone" - there's no rule saying how long that lasts and how long it still detects as magic. Lore has a lot of variation.
Don't Be That Guy
OK, so you had a good idea but it didn't pan out. Trying to get "the Internet to prove your GM wrong" on things like this is poorly conceived and destructive to the campaign, as you're clearly not working with him or her in good faith. So they didn't use Shory levels of magic in it, so the defenses wore down after 1000 years of shooting at wandering monsters, whatever. (Or, its magic is in an illusory or even weirder defense, as with Xin-Shalast from Rise of the Runelords.)