Actually combat vehicles are quite weaker than battlemechs when both of them are fully optimized, because of some reasons:
-Fusion Engines on the vehicles requires 50% more weights, the flaw that already makes battlemechs far superior over the vehicles alone. Even if you are ignore the other flaws on the vehicles, they are inferior to battlemechs just because of this.
-They can't use Endo Steel internal structure, which makes the weight gap even worse.
-Cannot use Double Heat Sinks at all, although they ignore almost all non-energy heat source.
--ACs, which should be one of the their favorate, is good on the close range, but they can't go melee.
-Turrets are good but requires more weights, and without those turrets they are no more than a joke.
-Crit roll against Combat Vehicles are more likely to destroy the components on the vehicle than mechs.
--Vehicles are destroyed as soon as ONE section of internal is destroyed, rather than mechs that keep lives until either head or center torso is destroyed.
-They are suffered by motive hits, that makes them easier to be immobilized.
-If an ammo rack is explodes, the vehicle lose all the ammunition rather than only a ton worth of ammo.
-Apart Hover/VTOL/WiGE, they are not so faster than mechs, and/or they are more weak. Most vehicles are also restricted by the terrain as well.
-Can't make melee attack.
-Can't use Jump Jets properly.
There are some pros on CVs, though it is not enough to beat mechs.
-Easy to use FF armors, although the benefit is superficial compared by mechs with Endo Steel - even Heavy FF doesn't make much weight saving.
-Ignore most non-energy heat source, although they can't use DHS as I said above.
-Can take Hover/VTOL.
-fewer parts means they are less likely to be penetrated by non-crit lucky shot on the weak spot. If it keep face to face with you, then you are end up with hit its front in the most times.
-Turrets are handy, although it requires more weight.
In the plain ground, perhaps some CVs claim victory over mechs sometimes. If it is succession war era it would be more likely to do, because Double Heat Sink is lostech in the era and both mechs and tanks are have similar firepower. Tanks are still worse because they requires 50% more weights for the fusion engine, although they saves the weights for the heat sinks depend on the weapon of choice.
But, with DHS, and same optimization, it is a tough mission to beat the mechs if what you have is the combat vehicles because combat vehicles are designed to be inferior to battlemechs. If you are lose with mechs most times, then the problem seems optimization and tactics, rather than the unit class' sheer power.
If both forces have similar level of commander, similar techs and similar size of force(and tonnage), then usually battlemechs have the upper hand unless the terrain is optimized for the vehicle force. Unfortunately, usually mechs are better at using the terrains too.
And... Infernos are bane of CVs, for each hits forces them to make a crit roll(although with decreased chance). If you are able to get close, kicking it will helps to destroy them too.