SHITARA, Japan — More than three centuries of tradition rest on Mao Takeshita’s narrow shoulders.

Mao is 6 years old and swaddled in a heavy kimono, her face covered in the thick white greasepaint of a Kabuki actor. Before her, an audience of hundreds sits on tatami mats. She steps forward, toward the footlights, and performs a dance, then introduces herself in the droning style of an ancient soliloquy.

Her appearance is an initiation of sorts, and Mao does it alone. When the new academic year begins, she will be the sole first grader at her school in Damine, a village in mountainous central Japan, where she will join a long but dwindling line of children who have performed the stylized dramas of Kabuki.

Every year, the students spend months preparing for their roles in an elaborate production staged by the villagers in honor of a Buddhist goddess. The intense commitment to the performance, for which Damine’s residents build a temporary theater from bamboo, has helped keep the elementary school alive even as many others across rural Japan have closed for lack of children.