The Duke and Duchess of Cambridge fell short to Prince Harry in a footrace that was held in support of their mental health campaign.