I have an xps 13 bought 5 years ago.
I'm getting also around 8-9 hours of browsing time if I occasionally open YouTube. Quite more if I only code and don't spawn docker apps like databases.
Spoiler, I use Xubuntu with CPU frequency set to power save but again, I've used this laptop massively during around 5 years already.
Sad to hear that. But yes, once the battery is replaced you'll get again a more than decent laptop.
Mine has 8gb of ram, which is still enough for most of what I do, including running VMs and docker compose intensively.