If you're running the game on an emulator, saving is an emulator setting rather than an in-game one. Configure the save type to 32K fram — sometimes listed as "FRAM 32Kbytes" — and the game will write its progress correctly.
On original hardware the game saves itself at the usual prompts, so no configuration is needed. If a battery-backed cart has finally died, that's a hardware replacement rather than a setting.