A wild-shaped druid is physically as good as any race horse, and mentally might have other advantages
What is a race horse?
The Monster Manual includes stat blocks for draft horses, riding horses, war horses, and ponies. There are no "race horses" in the rules, but we should not expect that every possible animal has a stat block1. You haven't told us what kind of race horses these are2, but it likely reasonable to take the stat block of a riding horse and modify it3 to make it faster but capable of carrying less weight4.
As you note, race horse breeds are different from other horses in terms of their physical form, and racing individuals are different from untrained individuals in their possession of hundreds of hours of training specific to their kind of race. If a race tests both the natural talent and training of the horse, it will be resolved by Ability Checks:
An ability check tests a character's or monster's innate talent and training in an effort to overcome a challenge.
When an individual with both natural aptitude and specialized training competes, the game represents this by giving them proficiency in a particular Skill.
The Skills entry is reserved for monsters that are proficient in one or more skills. For example, a monster that is very perceptive and stealthy might have bonuses to Wisdom (Perception) and Dexterity (Stealth) checks...Other modifiers might apply. For instance, a monster might have a larger-than-expected bonus (usually double its proficiency bonus) to account for its heightened expertise.
A riding horse has a +2 proficiency bonus, but is not proficient in any skills. A race horse, however, the product of months or even years of training for specific skills, will have its skills reflected in its variant stat block. The specific proficiencies assigned by the DM should relate to the kind of race. For example, horses that have to jump obstacles might have an Athletics proficiency. Horses that have to maintain a certain gait under speed might have an Acrobatics proficiency. Horses that have to maintain speed over long distances might have a proficiency in Constitution checks (and see the Hobgoblin's answer about using the Chase rules).
Physical equivalence
So now our druid, an ingenue to racing in a horse body, attempts to wild shape themselves into a race horse. Can they become an actual race horse, or are they limited to a riding horse form because that has an official stat block?
The wild shape rules say:
Starting at 2nd level, you can use your action to magically assume the shape of a beast that you have seen before.
Note that this is not limited to, for example, beasts in the Monster Manual, or beasts that have an official stat block. Any beast the druid has seen is fair game. Thus, if a druid had never seen a race horse before, they might be limited to the stat block of a riding horse, with its slower speed. But once they have seen a race horse, the druid can adopt that form.
But once in the body of a race horse, specialized for the particular kind of race, will the druid lack the training the other natural horses have? No, because the creature rules in 5e represent this training as a skill, and the druid assumes all the skills of the beast they become:
You also retain all of your skill and saving throw proficiencies, in addition to gaining those of the creature.
So, no matter the hours of training a race horse has had, once a druid has seen the horse, they are capable of changing into the form of a horse with just as much training. This may seem strange or counter-intuitive to you, given your statements that: "it doesn’t make sense that the druid could keep up in a race with horses, who have been horses their entire lives and have been trained to be a racer...the horses that have hundreds upon hundreds of hours as a trained racer?" But it is the way the wild shape rules work; the druid gets to assume the proficiencies of the beast5. If it makes it easier for you, you can consider the advantage of all this training to be subconscious muscle memory and physical conditioning rather than learned behavior.
Thus we can see that at a minimum, a druid is the physical equivalent of a natural race horse.
Int, Wis, Cha
One thing that the druid retains is their Intelligence, Wisdom, and Charisma scores. Since these are respectively 2, 11, and 7 for a riding horse, most likely the druid's scores are better. Here is where the druid might even have an advantage over natural race horses. Depending on the type of race, and how the DM chose to run it, the wild shaped druid might be permitted certain checks that could influence the outcome. The druid might use an Intelligence (Investigation) to go over the course beforehand, finding areas of loose dirt to avoid or memorizing corners and being able to anticipate them and move to the inside in a race. During the race the druid might use Wisdom (Perception) to note where the lowest spot was on a hedge they needed to jump or Wisdom (Insight) to predict how a competitor might react to a difficult uphill section. They might make a Charisma (Intimidation) roll to get a competitor to back off rather then passing them. Such opposed or unopposed checks could favor the druid over natural horses.
Mounted 'Combat'
The druid might not be the only one on their side in the race. Does the wild-shaped horse have a rider or driver? If so, as an intelligent mount, the druid would need to decide whether it was controlled or not. Submitting to the control of their rider allows them to use the rider's Initiative - and since the riding horse has a Dex mod of 0, a dexterous rider could give the druid an initiative advantage over the other horses - although it would restrict the druid's possible actions. If the druid was independent, however, they would be permitted the Help action, which might benefit a driver needing to make checks, for example a chariot or sulky driver who needed to make Vehicle Proficiency checks to maneuver.
A wild-shaped druid is physically as good as any race horse, and mentally might have other advantages over natural horses.
1 As the Monster Manual says in the Other Animals sidebar:
A book of this size can't contain statistics for every animal inhabiting your D&D campaign world. However, you can use the stat block of one animal to represent another easily enough. For example, you can use the panther statistics to represent a jaguar, the giant goat statistics to represent a buffalo, and the hawk statistics to represent a falcon.
2 You haven't told us what kind of race horses these are - do they run on flat tracks, or jump, or run endurance races over open terrain? Do they bear riders, are they riderless, or do they pull sulkies? Do they bear saddles or handicapping weights?
3 We are encouraged to do just this by the Modifying Creatures sidebar in the Basic Rules:
Despite the versatile collection of monsters in the Monster Manual, you might be at a loss when it comes to finding the perfect creature for part of an adventure. Feel free to tweak an existing creature to make it into something more useful for you, perhaps by borrowing a trait or two from a different monster or by using a variant or template.
4 We can find riding horses in the PHB Mounts and Vehicles. But while there, we note this (emphasis mine):
A good mount can help you move more quickly through the wilderness, but its primary purpose is to carry the gear that would otherwise slow you down. The Mounts and Other Animals table shows each animal’s speed and base carrying capacity.
Thus, while a riding horse stat block might be a 'good enough' approximation of a race horse in combat or other contexts, it should not be representative of the speed of a race horse. The riding horse is no faster than the warhorse, and it can carry loads of 480 pounds, considerably heavier than any race horse would be able to bear at speed.
For a race horse, we should be creating a variant riding horse that is faster but can carry less weight.
5 For example, a druid who had seen only Cows (VGtM) could transform into one and have its strength. But a druid who had seen an Ox (VGtM/MMoM) could assume that form with their wild shape, including their Beast of Burden feature which allows them to pull heavier loads, a trait which presumably is at least in part due to their training and experience as a draft animal.