Copy and pasted from another thread I posted on about the same subject:
Her AI is programmed to travel faster the faster you mash the button so mashing it fast from the beginning will make it harder for you. The best strategy is to start slowly, not actually slow just mash the button without straining yourself, then go faster as you near the end. Don't be afraid if you're behind her for most of the time just try not to fall too far back and don't go all out until you're near the end. It should take some time to find out when to speed up but the race is not too long so it should only take a few tries. Hope this helps and good luck.