They should be keeping them in something like kwallet. But in practice they don't because a) there isn't really a single standard for that on Linux (yeay, I have to support gnome-keyring too!), b) it's a lot more work than using a plain text file, c) the UX is considerably worse, and d) the security benefits are marginal at best (especially if you have full disk encryption).
Plain text is the most sensible option.
Interesting how do you do that exactly?
I was thinking you can just start the app that has permission to read the wallet, attach a debugger and then inject code to dump the wallet. It's definitely more complicated than reading a plain text file but not fundamentally less possible.
But really if you have that level of access it's game over anyway and you just MitM sudo and get root access, or use one of the many local privilege escalation vulnerabilities and get root immediately.