To be fair, the idea that a 20 ton mech could tower over an 80 or 60 ton tank is not completely bonkers, the different structure makes that possible. It's just that if that's the case, you are indeed dealing with a much better target as the armour's probably thinner (to cover a greater area) and the mech is much less stable on practically all terrain. In nearly all cases, a tracked or wheeled vehicle is just much more capable for much lower cost.
But, well, Battletech doesn't care, it's mech vs mech combat.
Exactly this.
You can't just look at size and go "That must be heavier because it's larger". For one, ground vehicles are much more condensed in design where everything is sat within a foot or two of every thing else, Mech design has a lot more "Empty space" with entire sections of their design dedicated to nothing but support capability just to keep the whole thing working optimally (And why depending on the specific Mech certain things like a leg shot are so devastating), with those sections of the Mech only containing the more basics of functionality like actuators and maybe some heat sinks to assist with passive cooling. And these sections make up a good 35-45% of a Mechs total physical 'size' in relation to the rest of the Mechs design.
But even in BattleTech, the heavier ground vehicles often have more protective armour on a single side than a light mech does across all their body. Mechs traditionally have marginally better structural protection behind the armour which kind of makes sense given that traditional ground vehicles are much more tightly compact with their internals with every inch of space being valuable. If one section of a ground vehicle goes, then traditionally everything goes because it's all so tightly contained. And that is the ultimate weakness of the ground vehicle. If it wasn't for that little detail then they would fundamentally be superior to Mechs in most practical ways outside of mobility.
As a Mech has more physical real estate to spread out internal components within a section without having to sacrifice structural protection before the layers of armour if a section of the Mech is taken out then unless there are secondary detonations like ammo explosions, all the Mech loses is that functionality that particular part of the Mechs design provided (And potentially any connected limbs that may also be lost in cases of losing side torsos).
So in a nutshell....
Your average Mech is less susceptible to being completely taken out of a battle from focused fire, it might lose some components and functionality, but it can still be operationally effective to the mission.
Every traditional ground vehicle will quickly crumble when exposed to focused fire. As soon as one side of the vehicles superior protective armour collapses, the entirety of the vehicle is now exposed and likely to explode at the slightest bit of additional damage taken.
And that's likely a large reasons Mechs were invented and put into use. They sacrifice overall protectiveness for introducing multiple layers of redundancy that can be patched up post-operation.
Side note, Mechs do also have some additional benefits in mobility able to traverse some terrain traditional ground vehicles could not due to the difference in locomotion method, traditional ground vehicles are still dragging themselves along the ground and any object in their linear path is a disruption, Mechs move like humans and other animals by taking steps between two points, any obstruction between those two points doesn't matter providing it can step over it and the next step location offers sufficient stability to support the Mech.
Of course mobility is not the same as stability, yes Mechs offer better mobility but they do so by being significantly less stable.