While weight training in College (decades ago), I found that general fitness helped even my rock climbing greatly. Combining regular weights with running got me into the best shape I've ever been in.
Now, with my upper body strength greatly lessened, I'm tempted to join a gym. But, I just do mostly class 4 or less, and then not very much. I've always hoped to return to the vertical walls, but not able to do a single chin-up, now, heavily discourages that!
I would need a personal trainer, which I could never afford. Buying into gym membership might help you to maintain your weight and general overall fitness.
I was taught there are two kinds of exercise, anaerobic (weights) and aerobic (endurance). Both should be pursued for mountaineering. But, if you only hike, I'd say save your money, and keep up hiking/walking/biking to avoid the pounds, or to keep you in condition.