Tracking player place in a race

I am trying to create a system that will give the player an accurate place number out of 12 racers. However, I am not sure how to do this on a course that is not straight. I found this article that is sort of asking the same thing, however, its solution is more about checking checkpoints and laps, which would not be accurate for my needs.

The course, shown below, follows the red line. They start at the yellow dot and pass two checkpoints (blue dots), before finishing at the green dot.

I would like to be as accurate as possible. Any suggestions and ideas are much appreciated as always.