1. Stick to terrain that the vehicles can't reach.
2. Blow up the vehicles with whatever you've got.
Really that is what it boils down to, and so let us discuss option 1. If you force the enemy to dismount and come to you then what range you decide to engage the enemy has more to do with terrain and opportunity than tactics. Dismount to dismount tactics are well documented, and here marksmanship is very important to allow maneuver.
The second option, blowing stuff up, requires you to close with the enemy. John Mosby has written here http://mountainguerrilla.blogspot.com/2012/07/stealth-is-survival-or-victory-is-in.html about getting close, hitting hard, and getting out. What he writes is sound, and I would simply like to add on my thoughts to the matter.
To hit hard against a better equipped force you need explosives, or something that provides the same "shock" and damage effect on your enemy. Honestly the old RPG-7 is too small for this role anymore with the anti-armor cages and nets on armored vehicles. We are talking things like an anti tank recoilless rifle, a shoulder launched anti tank missile, a command detonated anti vehicle mine, an anti tank grenade. Here is an example of Iraqi Insurgents using the RKG-3 anti tank grenade. This is what closing with a mounted armored force looks like in an urban area.
What the Iraqi Insurgents failed to do was capitalize on their initial "boom" with follow on effects. Remember, there is no silver bullet in warfare, what you need is the right mix of tools in the toolbox to build your victory, and while I stress rifle marksmanship it is just one tool in the box.