Who would have bet on this outcome? After months of moping and foot-dragging, the Buffalo teachers union and the school district have agreed on a teacher evaluation plan that gained state approval, while their peers in Hamburg came up short. Disastrously short, if Gov. Andrew M. Cuomo sticks to his word.

Thursday was the deadline for school districts to secure state approval of their teacher evaluation plans or forfeit this year’s increase in state aid to education. With the last-minute approval of Buffalo’s plan, the school district saved $33.4 million in state aid, as well as millions more in other funds that had been threatened.

That happy outcome didn’t seem at all likely, given the allergic reaction of the Buffalo Teachers Federation to any kind of evaluation and President Philip Rumore’s unwise linking of the issue to the unrelated matter of teacher transfers that had been ruled inappropriate. But the issues came together over the past week or so, as the district and union resolved the transfer issue, then quickly hammered out an evaluation agreement, revised it at the state’s demand and then, finally, won approval.

State Education Commissioner John B. King Jr. said:

“The new evaluation plan is great news for Buffalo teachers, administrators, parents and, most important, Buffalo students. It’s a strong step toward helping teachers and principals improve their practice, which will in turn help students improve their performance and build a better future.”

Only about a half-dozen school districts in the state failed to meet the deadline, but unfortunately, those districts include Hamburg. New York City also failed to get the job done.

For Hamburg – or more accurately, Hamburg’s students – the failure of adults to do their jobs will likely cost them $454,000 in state aid. That’s pathetic, and especially so because of the reason they failed.

Reports suggested that the union and district were on track to reach an agreement on Tuesday when a district official told some teachers that their jobs would be lost if an agreement wasn’t reached. The union objected to what it saw as an implied threat and cut off negotiations.

We don’t know exactly what the district official said or in what tone of voice, and maybe whoever it was shouldn’t have said that. Still, it doesn’t take a high school diploma to figure out that the loss of $454,000 might cost some people their jobs. So was the comment a threat or an observation?

It doesn’t matter now. The union walked away, the district flunked a critical test and the students will pay the consequences. It’s hard to see how Cuomo can back down from the ultimatum – written into state law – without undermining his credibility. He needs to let the consequences play out.

It’s a terrible penalty that Hamburg’s students are going to pay, but it is a relief that Buffalo managed to get the job done. Even then, Rumore was characteristically dramatic, telling a reporter that “I had to negotiate this, but I almost feel like I’m an accessory to a crime.”

He should relax. He’s an accessory to helping the state improve the quality of education in New York by giving administrators a tool to measure results and provide assistance to teachers who need it.

That’s not only not a bad thing, it’s an urgent thing.