Law owned in his own shit, NOT expected, he was supposedly the truth in Room.
In fair combat, yes. In this situation however, nope.
The first thing Law tried to do was to get his heart back, and any move that is not a offensive one against a guy like Vergo is a wasted move. Vergo Soru over to Law and kicked his ass, Law has no chance while his heart is in Vergo's hands.
This was a luck of the draw thing. Remember, Smoker was supposed to be fighting Vergo while Law was poking around SAD, but he encountered CC with Luffy instead. CC's henchmen announced that Law was in the the SAD room making him Vergo's target.
As Law pointed out Vergo is the one person he didn't account for in this island, he probably wanted to avoid him until he got his heart back.