Proper quality (i.e. non-Roman) shielded medium cavalry can beat similar quality lancers in direct melee due to the extra defense from the shield. They can dodge the initial charge from the lancers by running perpendicular to the direction of the charge, which somewhat cancels or at least screw the charge up bad. Against heavier cavalry, the faster medium cav can charge in to the heavy cavalry side while the heavy cavalry are forming up to charge into your infantry, then backing off and causing the heavy cavalry to chase a little, which results in them to have to form up again.

By the way, equites romani is definitely cost ineffective, so I wouldn't use them for general price comparison of cavalry. I never used them during my Romani campaigns, prefering Ligurian cavalry and Greek Hippies, which are cheaper and actually better, if not the same.