You buy whatever bike you want that you can afford, with consideration of how it's going to get fixed when it goes wrong, which will happen sooner or later.
For road and trails, all electric bikes work pretty well. You don't need to spend anything like that money to get a nice bike that does...