YUBARI, Japan — Most young people have already fled this city of empty streets and shuttered schools, whose bankrupt local government collapsed under the twin burdens of debt and demographics that are slowly afflicting the rest of Japan.


Now, Yubari, a former coal-mining town on Japan’s northernmost main island, Hokkaido, is hoping an unlikely savior can reverse its long decline: a 31-year-old rookie mayor who has come to symbolize the struggle confronting young Japanese in the world’s most graying and indebted nation.


“Japan  will tread the same path someday,” said Naomichi Suzuki, who a year ago this month became the youngest mayor of the country’s most rapidly aging city. “If we can’t save Yubari, what will it mean for the rest of Japan?”


Indeed, the city’s plight and attempt to fight back — which has become a story line in the national media — could offer a glimpse of Japan’s future.


Japan’s overall population fell by a record quarter-million to 127.8 million last year, hurt by falling birthrates and people departing for other countries. By 2060, the Japanese population is expected to fall by an additional one-third, to as few as 87 million — and 40 percent of those remaining will be over 65 years old.


Japan’s national debt has not preoccupied the world the way Europe’s has. But after years of government spending to shore up the economy, Japanese public I.O.U.’s have mushroomed to almost $12 trillion — more than twice the size of its economy and the heaviest government debt burden in the world. (Its treasury is able to keep financing that debt load by issuing government bonds because Japan, like the United States, is still a global investment haven.)


But in Yubari, the demographic and fiscal demise is on fast-forward. The city’s population has plunged by 90 percent since its heyday as a coal-mining hub in the 1950s and ’60s. Currently, fewer than 10,500 people live in a geographic area approximately the size of New York City. And of those remaining Yubari residents, nearly half are older than 65.


And unlike the national government, Yubari has already faced its day of reckoning with creditors. Crippled by the closure of its coal mines as Japan moved to petroleum-based fuels and nuclear power, and after a failed bid to revive its tourism economy with subsidies from the central government, Yubari went bankrupt in 2007, owing more than $400 million to holders of its municipal bonds.


Under Japanese law that debt must still be repaid under a bankruptcy reorganization the city will be laboring under for the next 15 years.


The city’s services have been cut to the bone, and the public work force of about 300 has been cut by half. Yubari’s winter festivals have been canceled, its public bath closed and its six elementary schools consolidated into one. The aftermath of the March 2011 tsunami further decimated local tourism.


Yubari cut back on its snow-clearing, and its treasured art museum collapsed under the weight of the accumulated snow. There was no money to rebuild.


Even the growers of the region’s famed cantaloupe melon, which can sell for almost $100 each, are struggling as a younger generation has left farms behind for better jobs elsewhere. Meanwhile, the handful of companies still here complain of a dearth of workers; all but 4 of the 20 employees at the Yubari Tsumura pharmaceutical plant commute from outside the city.


“Something needed to be done to stop the bleeding,” said Shizuo Shibata, 77, a retired school district worker who has spent his whole life in Yubari. “But anyone who had prospects is leaving.”


It was into these depths of despair that Mr. Suzuki, then a 26-year-old public servant in the city of Tokyo’s social welfare department, was dispatched to Yubari on a yearlong loan from the Tokyo Metropolitan Government.


By all accounts here, he quickly established rapport with the locals, volunteering his free time to help resuscitate the city’s annual film festival and checking in regularly with his elderly neighbors. (Mr. Suzuki concedes he had little else to do during the long winter evenings.) At the same time, the city’s younger people came to consider him a generational leader. Mr. Suzuki began to advocate a new way of thinking in Yubari: what if the city could do more to safeguard the most essential public services, while negotiating better terms on its debt repayments with the central government?