I think a lot of folks who have gotten into the emtb thing in recent years come from past years of pedal-only MTB...but...maybe age has taken its toll on the ability to keep up a fun level of trail speed. Coming from many years MTB and dirt motorcycle, I know the emtb has reenergized my riding due to being able to go at least as fast as I used to.
But don't be fooled. Unless one is just plodding along out on a trail on their emtb, I find basically the same level of effort and aerobic benefit as I got on my MTB. I go further and faster, but I still get a full dose of exercise.
On your gym experience, this has never been my cup-o-tea. I cannot stand to workout on a static piece of equipment period. That's not a bash to those who can have the discipline and maybe even the enjoyment of a gym workout, but I have never had that commitment to it and certainly not the discipline. Now, I have no problem to committing to 4 or even 5 rides a week on my emtb and thoroughly enjoying everyone of them. I live in a region that allows year round riding, so it's fairly easy for me to accomplish all year.
Not sure I fully understand the part of your post about maybe wanting to get an emtb but wanting to train at home...not knowing your distance to trails and such. For me, my closest trail is only about 12 minutes from my home, so it's no burden to go to the trail. Of course, there is always the option of doing both, and if you like gym training there's no need to pass on an emtb. Do your gym workout, and you'll enjoy your fitness level even more when you ride the emtb.
Remember like I said, unless you're just poking along on the trail on an emtb, you will get a real workout. And don't forget that most all emtb's have the option of different levels of rider effort required...not unlike turning up the effort on your individual piece of gym equipment.