Probably, I’d say most sports/activities would be better for most people than going to the gym, as far as general fitness is concerned. Exceptions being bodybuilders.
If you’re doing an activity you enjoy then it’s no longer mundane like the gym can be (granted there can be a social aspect to gyms). Also for most people they’ll tend to spend only say 30mins or 1 hour in the gym whereas with a sporting activity you’re really into you might well end up doing it for the best part of a Saturday or Sunday.
With a hobby like that you’ll tend to want to progress and do more… cycle further, climb a bigger or more technical mountain, tackle a more difficult river or take a trip lasting a few days etc..
Gyms are notorious for people signing up then letting the membership expire/quitting. Find a hobby you can really get into and you can stick with it for years.
Look at any serious cyclist, mountaineer, canoeist etc… they’ll tend to be in very good shape. I remember doing the JP Morgan charity run a few times and noticing how unfit lots of the bodybuilder types from my company were, it’s not like they were particularly massive either, just a bit muscular.