A state appeals court yesterday handed another defeat to Mayor Bloomberg — and a victory to soda drinkers throughout the city — by deeming Hizzoner’s proposed soda ban an “invalid” overreach of government regulation.

The Appellate Division justices also criticized Bloomberg and the city’s Health Department for even proposing a ban with such giant loopholes: It would prohibit supersized colas and energy drinks, but allow oversized milkshakes and fruit juices.

Similarly, businesses such as delis and restaurants would be prevented from hawking sugary beverages, while 7-Eleven could still sell its Big Gulp under the plan.

The judges said those inconsistencies go “beyond health concerns, in that it manipulates choices to try to change consumer norms.”

In March, a lower-court judge first rejected the ban.

Bloomberg yesterday called the decision “a temporary setback” in his crusade to reduce obesity in the Big Apple, adding that he planned to submit an appeal to the state’s highest court.