You have to play it smart, there's no other way, unfortunately. If you are leading, drive as fast as possible to gap other players. If you can't and there's someone coming for you, let them by and wait for their mistake.
I had race like that few days ago, it was Rally stunt race. I was 2nd on the grid, tried to make a break, but with catchup on it wasn't possible. What I did? I let others by, one by one, constantly looking at the minimap and behind me, trying not to be taken out. When I was sure there was no danger from behind, I started to play the waiting game, picking them one after another, while they were making expected mistakes. I was quickly up from 7th to 2nd and had absolutely fantastic second part of that race including a lot of clean overtakes with someone, who as it turned out, was also in a racing crew