For some reason the AI is much faster when it's driving in front of you vs behind you so the best strategy is to take the lead early and keep it.
I noticed on Le Mans races that if you pass a higher class car and keep a good pace it won't be able to pass you unless you make a really stupid mistake

ACAB