this was a pretty interesting problem with mechs in Battlefield 2142. Like sure, they make sense, the legs would make it easier to traverse difficult terrain, but you're also much higher off the ground, making you a bigger target than you need to be, causing the tanks to be superior in pretty much every scenario
there are probably a couple niche scenarios in which a mech would be better