Hmmmmm...
Not sure I've ever encountered this. Yes it would be easier if it were straight. I know I've played at least one other racing game in DB. But it didn't have any ranking system (or indeed a way to finish the race other than exiting) you just went round and round.
The only way I can think of it to have some "zones" where it senses which cars are in them and has a little array to show which zones are further up the track than the others. The more zones and the smaller they are, the more accurate the ranking system will be, but the slower the prog will be in the end. this could be quite tricky.
Is this in DBC?
Dead against necromancy...