A large armored humanoid machine. Generally ranging from 4-15 meters tall, usually packing a rifle and maybe a few missiles.
Mobile suits can universally take an RPG to any point without suffering much more than needing a new paint job afterwards.
Veritech's vary from design to design on whether or not they can take an RPG but generally no they can't.
Super robots can generally take plot based amounts of damage, sometimes they get trashed quick other times they are invincible, but those are like superheroes in that way.
Knightmares can take anything up to a 90mm cannon, at least that's the impression I got from what I watched, after that point they start taking damage, those are realistic but not viable since an abrams can take a 120 mm on the front hull or turret and be basically unharmed (yes that thing is so stupifyingly heavily armored it cannot hurt itself in the places it will generally let you see.) and they can move about the same speed, except the lancelot which is a supermech if I ever saw one.
Armor Core mechs also vary but those things are freaking huge and a 110mm cannon is a machine gun to those things.
Battletech mechs are horrible I don't know why they use them.
40k mechs aren't too much better, then again 40k tech in general sucks, modern humans would crush them horribly. The only vehicles I see as being viable here are the Tau Empire Battlesuits, those things kick ass, but are classified as powered armor not mecha, despite them functioning like mecha(you sit in a cockpit and you command the thing with your brain like you would your own body, funny stories abound about this)
The FMP Arm Slaves are truly impressive machines but they are still really big and fall apart kinda easy, since they attempt to use real world physics.
The Blue Gender Armored Shrikes suck noodle, specifically in the department of firepower, guns of that caliber should blow through anything but the most stout of force fields.
Oddly enough The Big Guy from Fox's Big Guy and Rusty was a truly horrifying piece of machinery mostly due to the amount of firepower the thing had (15 feet 4 machine guns at least 6 missile launchers and, I think, 2 plasma cannons, laser beams in its eyes.)
Evangelion units were powerful but dangerous to everyone including the pilots, there weren't very many, and they came with the horrifying realization that everyone is going to be turned into orange goo.
There are others but I'm not gonna list them all. The point is that mechs are not viable because of the same reason tanks are so short, and that is anything that is over a certain height will get hammered down on a modern battle field, Helicopters and Planes are fine because helicopters carry so much firepower no one wants to go near them and they can fly stupifyingly fast for vehicles which use propellers, and are immune to small arms fire unless you hit the hardest part on the entire vehicle, the rotor connecting the rest of the vehicle to the propeller, if they have a good pilot they can dodge RPGs, and planes are nothing but speed and guns two things I suggest ever war machine have.
Tanks get to continue on for the next few decades because they are handy for when you need to slug it out with anyone, I'm not entirely sure of the tanks future either the bloody things are expensive and hard to maintain compared to other vehicles plus they are expensive and hard to transport because of their weight.
/text wall