Persim berries shouldn't prevent mega evolving. Are you playing a special format where mega evolving isn't allowed? Did Rayquaza always know dragon ascent? Did you already mega evolve another Pokemon in that battle? (mega evolving Rayquaza, letting it faint, and reviving it should count as "already mega evolved" and prevent you from doing it again, but that probably isn't what happened here)