Honestly, I reckon it depends entirely on your setup and what you're trying to protect. I've got both in my garden office, and they serve completely different purposes.
Battery backup is silent, instant, and brilliant for short outages. My Victron system kicks in before the lights even flicker. Perfect if you're working and need uninterrupted power. The downside? Cost is eye-watering, and capacity is limited unless you're willing to spend serious money. I'm running 10kWh and it's still not enough to run the kettle and the heating simultaneously without draining it.
Generators are cheap insurance if your main concern is a genuinely extended outage. Mine's only run a handful of times in three years, but knowing I could run the motorhome hookup or charge the batteries slowly feels secure. Downside: they're loud, need fuel storage, require maintenance, and you need fuel contingency sorted.
The sweet spot for me is layers. Batteries handle daily peak shaving and brief outages. Generator covers long blackouts or when I need to charge everything simultaneously. Running a gen for 2-3 hours at 25% load to top up batteries is way more efficient than running it flat-out.
What's your actual requirement? Are you looking at grid-resilience, off-grid living, or just paranoia about blackouts? That makes a massive difference to the answer. Also, how much space and budget are we talking?