The mayor of New York, Michael Bloomberg, vowed on Tuesday to continue his fight for a controversial ban on large sugary drinks after he leaves office, in a tacit admission that he will not be able to resurrect his signature health measure before a successor takes over.

After a state judge struck down the measure the day before it was due to come into force, Bloomberg called on the leading mayoral candidates to get behind it. But the ban appeared to be in tatters on Tuesday: any appeal is likely to outlast Bloomberg's mayoralty and the front-runners to succeed him have declared their opposition to the restrictions.

Speaking at a cafe in midtown Manhattan which has decided to voluntarily implement the suggested regulations, the mayor admitted his staffers "don't know" how long an appeal will take.

Asked by the Guardian if likely lengthy appeal process and the opposition of mayoral candidates meant that realistically the legislation was unlikely to be introduced, Bloomberg issued a rallying cry to the would-be-mayors.

"I would think that anybody who does get elected would be responsible and take on the same positions that Bill de Blasio, [a Democratic candidate for mayor who was present on Tuesday and is a public supporter of the ban] … these are the things that the public is going to expect from its elected officials," he said.

"If the job of saving your life or at least giving you the information to save your life isn't the primary purpose of being elected [then] I don't know why you would waste your time doing it, and I don't think you should be elected if that isn't what you're trying to do."

When the Guardian asked if Bloomberg could see the soda ban being something he continues pushing for after leaving office, the mayor replied: "You can take it to the bank."

"Yes, what I'm going to try to do is the same thing I've been doing. I want to leave this world a better place for my kids and for their kids, and shame on me if I don't," he said.

Rules banning the sale of sugary drinks larger than 16oz (473ml) were due to come into effect in New York City on Tuesday, in the first attempt in the US to tackle rising obesity levels by placing legal limits on portion sizes.

Instead of celebrating the implementation, however, Bloomberg found himself giving a press conference at Lucky's Cafe in Manhattan, which had decided to do away with sugary drinks larger than 16oz of its own accord. The mayor insisted, as he had on Monday, that the judge who ruled against the ban on Monday was "in error". "We will appeal the judge's decision," he insisted. "We are confident we will win that."

But Bloomberg admitted: "We don't know how long any appeal process is going to take. He knows there is an expectation that the special interest groups who won the appeal the day before the ban's implementation – including the American Beverage Association – could now act to slow down a counter appeal. If it is unresolved by the time Bloomberg leaves office at the end of the year, the impetus could fall to the next mayor to push it through.

Despite de Blasio's support, some of the leading candidates have said they will not pursue the ban if they win office. Christine Quinn, the current speaker of New York City and presumed frontrunner for the Democratic nomination, told CNN on Monday that she was opposed to Bloomberg's law. Quinn said: "my fear is that with issues around food and obesity if you say 'no' people almost have a reflex reaction to do it."

Joe Lhota, the former MTA chief, has said he would not reverse the soda ban if it is already implemented, but he would have opted for a broader public education campaign before seeking a ban, according to NBC. John Liu, New York City comptroller, expressed scepticism over the ban last year.

The ban was struck down by state judge Milton Tingling in a 37-page ruling on Monday. He said the ban was "fraught with arbitrary and capricious consequences" that made the task of enforcing it almost impossible "even within a particular city block, much less the city as a whole".

Tingling listed inconsistencies in the plan: that it did not apply to every food establishment in the city, that it excluded some drinks that had higher concentrations of sugar or calories "on suspect grounds", and that it did not limit the amount of refills. These served only to "gut the purpose of the rule", the judge said. © Guardian News and Media 2013