More advice than a guide, I believe this is actually unmissable as is part of the story line.
To win the race I would recommend racing manually and going at a steady speed. Look on the map and see where it starts and try to gauge the stamina to where you are on the course.
I lost my first race as didn't use the map and finished with nearly all my stamina. Then second race finished about 10 seconds before the AI and still with well over half my stamina. Popped as loaded back into the jockey lounge.