RIO DE JANEIRO—Mariuza da Conceição Aparecida taught math and science at public schools for 27 years, enough to retire on a full pension in her late 50s.

Last year, more than two decades later, the 80-year-old was forced to wait in line at food banks. Swelling retirement obligations have nearly bankrupted the Rio de Janeiro state government, leaving Ms. Aparecida without her pension checks for as long as four months at a time. She resorted to singing in the streets to draw attention to the situation of the elderly.

“It...