The rapid evolution of AGN feedback in brightest cluster galaxies: switching from quasar-mode to radio-mode feedback