This advice is originally derived from experience with Battletech and Ogre, but it can be applied to any situation where you have to deal with a giant robot tank of any kind, ranging from Ogres or Bolos to even massive mecha, from Mechagodzilla to Battlemechs, with a numerically superior force. The softlinks are rife with good examples. TheBooBooKitty, however, informs me that there's another method entirely.
So you have to deal with a robot tank. Well, it sure sucks to be you. But, with a lot of luck, some intelligent tactics, and whole lot of casualties, you, too, can outwit, and defeat, a robot tank.
First things first. The robot tank is going to demolish your force part-by-part, if you give it the chance. There are two ways to help prevent this. You can make a coordinated attack with all of your forces, overwhelming the tank with sheer firepower. If you want to do this, make sure you attack to neutralize its weaponry first, increasing your advantage in potential for damage. This method is advisable if your force is numerically superior, or if it's composed of some kind of slower, hard-hitting elements (battletanks, for example), and is the most difficult to overcome for the robot tank. If your target is faster or significantly longer-ranged, or if you are utterly outmatched, this strategy is less advisable.
Let's say that you don't have the benefit of a superior force on your side. In this case, it's time to neutralize the advantages of the robot tank.
First off, its mass. While it's assumed that blowing bits off it willy-nilly to whittle it down is not an option, eliminating its ability to move gives it no way to exploit its mass. No matter what you're trying to stop the robot tank from doing, if it can move, it's got the potential to frustrate your defense, if only by running over, ramming, or stomping on things. The first target is the locomotion. Be it treads, wheels, legs, or interstellar engines, that has to be your first target. This is much easier if you can mire the tank in a swamp, ruins, asteroid field, whatever. Suicidal attacks, guerrilla action, sabotage, hit-and-run attacks, or simply fire from outside the tank's range are all effective methods to accomplish this; simply use whatever tools are available. Bear in mind that this is the most dangerous part of the process, and can neccessitate ridiculous casualties, with no guarantee of success.
Now the target is immobilized (or close to), which gives you the all-important time that you need. Now, you need to deal with the robot tank's ranged weaponry. (Alternately, if it has none, evacuate the area. It can't destroy anything but as far as it can reach, so it's just now part of the landscape.) Given that, just don't let the robot tank shoot you while you're doing this. (Alternately, the same methods used to disable the locomotion can be used here, but they tend to be much riskier.) Given this, there are three methods to prevent counterattacks. First, you can outrange the tank, especially since it can no longer close the gap. Secondly, you can obscure yourself from attack; targeting the sensors of the tank can often aid in this goal. Thirdly, you can hit and run, making yourself too evasive of a target for the tank to hit.
Now the tank can't move, and can't shoot. Unless it can catastrophically self-destruct (in which case you will need to obliterate it with sheer force very quickly), you may now drag it to whereever is out of the way, because you now have a robot pile of scrap, as opposed to a robot tank. Feel free to celebrate with the tattered remnants of your battered force.
If all else fails, there's always witty banter.
DISCLAIMER: This node assumes that you aren't Godzilla. If you are, you will need to use entirely different methods to deal with the robot tank.