Yeah all depends on your goals and what you want to accomplish; it is the reason you rarely see a really buff guy doing marathons or crazy hikes. All that muscle makes it harder to do that stuff since you have the added weight mass which uses up a lot of oxygen.
Also hiking is going to hit muscles that are very hard to workout in a gym since a lot of them are small stabilizing muscles your legs use when on un-level surfaces (like rocks). I work out my legs every week and run a few miles a week, yet a hike always gets me sore in my front bottom leg region (opposite calves; extensor muscles).
So are you just sore from the hike or were you just not able to complete it?