That's a debate that has no absolute correct answer, the decision is very much up to the developer and his skill.
However, in this case, the navigation bar is not generated by php - if it were then I would probably have assigned the selected state server side because the href wouldn't have to be given to php manually for each link.
My opinion in reply your arguments:
1. It's about selecting an element and changing its style. It's only about generating markup if you make it that way.
2. Browsers have javascript enabled by default, if users choose to disable it then they realise that they are removing their browsers ability to interact with html and thus downgrading their web experience.
3. Mobile browser support for javascript is actually very similar to desktop support, if you had said that 5 years a go I'd have agreed with you though.
4. Adding a class to an element is not computationally intensive, and it will not add any significant latency to the browsing experience. As browsers evolve, javascript speed improvements follow.
5. Forcing php to parse an otherwise plain html document for just 1 UI element will add far more latency to the process than downloading and running 4 lines of javascript.
Anyway, since the OP has requested help, the easier option (javascript) is probably the best one - otherwise OP would have worked out the more complex option by now