Mechs are overrated anyway and anything a mech can do, you can do the same and better for cheaper by improving a tank.
From a physical perspective then waling on legs and having a weight above a few tons are a complete waste of energy and you would only be able to use this at any reasonable pace and manoeuvre on very hard grounds. Another bad problem is that walking on legs rather than wheels or track require way more energy for the weight supported and speed used.
Mechs walking on two legs are pure fantasy sci fi without some form of anti-gravity field to make the object very light.
In real life even soldiers today need to watch they weight while operating in areas with very soft ground, imagine adding even more weight without your feet being several feets worth. They have experimented with say exoskeletons so soldiers can carry more weight, the problem is that more weight is already a problem on a soldier today in some environments. It probably would generate more problem than it solves.
Another problem is spotting, a mech will by its very nature be quite tall in comparison with its weight, that is NOT a good thing in a modern battlefield.
I have no problem imagining super large vehicles, the problem is being able to spot before being spotted... given the destructive power of weapons this will not be smart in the future and I have a hard time imagining a future where this will not be true unless defences are way more powerful the weapons which does not seem likely anytime soon.