Try to get a dry charged battery (a battery that comes dry with a bottle of electrolyte and you add the electrolyte to it yourself) next time. Dry charged batteries will not start to degrade or sulphate until you add the electrolyte to them and have a much much longer storage life then ready to use batteries.
These lawnmower and power sports batteries tend to sit around on the shelf for a long time. They aren’t on a float charger and sulphate over the course of months or even years at a low state of charge.
If you can’t find a dry charged battery take a good mulit meter with you and don’t buy any batteries that are under 12.6 volts or more then 6 months old according to the date code. Try to get your battery from a place moves a large volume of mower batteries.
Lastly don’t discount installing a recoil starter on your riding mower, that was the best thing I ever did to mine no more dead batteries to deal with, no more problems with broken compression releases and anemic starters that can’t crank the engine without a compression release. Just give it a pull, hop on and mow.