A judge does not denege on a plea agreement.
The plea agreement is between the DA and the defendant.
The judge can rule however he wishes
First, read more about this case.
Second, any plea agreement is approved and then made official by the judge. Certainly, the judge CAN rule however he wants, but it is virtually unheard of for a plea agreement to be made, approved, and then changed solely by judges discretion at the last minute.