Papa Delta Bravo says that mechs will never actually appear on future battlefields. That's not because it will be impossible to build them, but because it would be an inefficient use of resources:

Ground pressure is the killing word to the armored war walker. Consider getting off the couch, strapping on a 100 pound backpack and going for a run. Now imagine you’re running through a patch of ankle deep sticky clay mud. Now imagine stopping or turning. DO NOT ACTUALLY ATTEMPT THIS, because you will BREAK A LEG OR POP A KNEE, fall face down in the mud, drown and die. This is what life will be like for a 20+ ton walker, every day, on all terrain.

The ground pressure that a 10t IFV exerts is less than a fully loaded infantry grunt.

Even if you imagine some spectacular future miracle technology or material that will remove some of the above problems, you’re still left with sky high ground pressure and I will use that same unobtanium to make better tanks and tank killing flyers that will make tin foil out of your walker.

Engineering is not about finding ways to make cool things work. It’s about solving problems at a lower fiscal, materials, logistical and manpower cost than current solutions. The purpose of a mechanized army is to take and hold territory by killing people and breaking their things. A force of armored walkers make this task harder, not easier.

This is pretty much my (uneducated) view, too. Another issue that PDB doesn't mention is that a mech has greater surface area than a tank, so armor of equivalent thickness would weigh more.