I’ve hard of this before and it usually seems the cause has something to do with the wiring that controls these warning lights. It could either be a bad earth or a broken wire, but in most cases the symptoms are the same; a flashing 4WD indicator light when the vehicle is in two-wheel-drive. I’ve also heard of dud ABS sensors triggering the same, or similar, warning lights on the dashboard.
These vehicles use servos to engage four-wheel-drive (unlike older vehicles which used a manual lever pulled on by the driver) so there’s a level of electronics involved. And that always means potential problems as the cars age, particularly a vehicle that may have seen its share of rough stuff over the years.
The best advice is to have a Mazda specialist interrogate the on-board computer, at which point the car should give up all its dirty little secrets, including why it thinks it’s in four-wheel-drive when it’s not.