Here's the scenario:
Mewtwo with unnerve is sent out. Opposing Pokemon cited "Too nervous to eat berries" Mewtwo mega evolves and loses unnerve Will the current opposing Pokemon be able to eat berries without switching out or not?
Ok so now that I have a idea of what your were talking so I tested this out on Pokemon Showdown and It would seem that Once Mewtwo mega evolves Unnerves effects go away after it loses the ability This Shows what I mean