This June 22nd saw the passing of a minor global icon—Tama the Stationmaster, a cat who had been adopted as a mascot by a rural Japanese train station. After her death at the venerable age of 16, thousands of Japanese attended her funeral, and tens of thousands more mourned her around the world as the story spread online.

As her various epitaphs noted, Tama became a major tourist attraction at Kishi Station, located in remote Kinokawa, Wakayama prefecture. In fact, by boosting ridership from 1.92 million in 2005 to 2.27 million in 2014, Tama saved the entire Kishigawa Line, and the Wakayama Electric Railway Company that runs it, from imminent closure. Much of the line is now pitched as a wistful tourist attraction, with cat-shaped station buildings and trains themed around cats, candy, and toys.

It’s a heartwarming story, but it takes place against a grim backdrop. Japan is globally admired for its smoothly-running urban train system, and trains are a large part of its postwar national identity. But the smaller, mostly private train lines that serve Japan’s countryside and outlying cities are under constant threat of closure as competitive and especially demographic pressures mount.

The northern island of Hokkaido, for instance, has lost 20 such lines in recent decades, according to the translator and writer Richard Hendy. Hendy has chronicled the decline of rural Japan extensively, including in a 2009 look at the shuttered Kashima Tetsudo train line in southern Ibaraki Prefecture.

The Kashima Tetsudo was similar to Tama’s Kishigawa Line in many ways—it served a shrinking rural population, in a region with declining industry, and the locals were fiercely attached to it for both sentimental and practical reasons. But no mascot appeared to save the Kashima Tetsudo, which closed in 2007—very close to the same time the Kishigawa would have closed without Tama’s intervention.

Hendy meticulously documented the cause of the Kashima Tetsudo’s fatal decline in ridership—the hollowing out of the small cities and towns it served. This is a microcosm of the broader collapse of rural Japan. 65.2% of the Japanese population occupied just 3.3% of the country’s land as of 2000, and nearly a quarter of all Japanese live in Tokyo.

This radical urbanization has been enabled largely by modern, high-speed trains such as the Shinkansen, which, starting in the 1960s, knitted Tokyo, Osaka, and Nagoya into one sprawling megalopolis. They’ve made it practical (if not necessarily comfortable) for those who work in Tokyo to live a hundred kilometers or more away from the city, leading to the famous images of white-gloved conductors shoving hordes of daily commuters onto morning and evening trains.

But that concentration has also helped beggar the Shinkansen’s lower-tech cousins and the regions they serve. From Ibaraki to Hokkaido, rural Japan is now rich in the kind of ‘ruin porn’ we in the U.S. have come to associate with desperate Rust Belt cities like Detroit.

The decline also reflects deeper demographic forces. Japan is widely admired as the longest-lived society on the planet—but it is also, a slight but crucial distinction, the oldest. It has among the lowest birth rates in the industrialized world, and unlike similarly low-birth Italy and Germany, its restrictive immigration policies have led its overall population to decline steadily since 2007. With young people continually flocking to the largest cities, many outlying regions are focusing their long-term plans not on growth, but on social services for the elderly and managed retrenchment.

Amidst all this, Japan’s celebrated next-generation train constitutes a bleak irony. The magnetically levitated Chuo Shinkansen will connect Nagoya and Tokyo in under 40 minutes, running at over 300 miles per hour. At a projected cost of over 9 trillion yen (more than $70 billion), the project will tie central Japan even more tightly together, and leave the margins even more marginal, older, and stagnant.

Train operators in Japan also double as tourism bureaus, promoting ridership by extolling the virtues of various regions. For rural areas like Wakayama, the appeal is often a nostalgic escape: As fan Haruto Maeda put it to CNN in 2008, visiting Tama was “a chance to take a break from the problems facing Japan.”

But regions like Wakayama, and the train lines that animate them, can’t continue outrun the forces arrayed against them. Tama has been replaced by a successor, Niitama. There will probably, five or ten years from now, be a Tama the Third.

Whether there will ever be a Tama the Fourth, Fifth, or Sixth, is a decidedly open question.