I would argue they both have advantages. JavaScripts golden trump card is that it runs in the browser and outside of ASM.js or wasm nothing else can.
ASM.js and wasm? Didn't get
Plus users are now used to SPAs (Single Page Applications) and data re-loading inline in the browser without a page refresh.
While the PHP and backend programming is cleaner / easier, users and service providers have moved away from that world for good reason -- because a SPA UI feels snappier to an end user than a page refresh.
Except when you're viewing on underpowered device and everything becomes choppy. I hope HTMX gets wider adoption, it seems to be reasonable compromise between SPA and backend rendering.