A user.js file is handy for configuring Firefox settings, especially for mass deployment and/or to save having to hunt through about:config etc.
As far as I'm aware, you're restricted from setting the search engine via user.js or even about:config, even though you can set almost any/every other setting this way.
From memory it was restricted due to concerns of mis-use.
Hoping we can get the functionality revisited 👍
Thanks for submitting an idea to the Mozilla Connect community! Your idea is now open to votes (aka kudos) and comments.
If you are deploying to an enterprise, then you should use the enterprise distributions with enterprise policies set-up. See here for more information: https://www.mozilla.org/firefox/enterprise/