Why 6 races are not sufficient in the 25 horses, 5 tracks problem
Assume that you have an algorithm to find the first three places in 6 races. Assume that after the fifth race $n$ horses have raced. If $n=25$, then the last race can detemine only the winner, but not the second nor the third place: it has to race one horse from each previous race, so if the first three places were all in the same heat or 1,2 in the same and 3 in a different, it couldn't tell the difference.
So $n<25$, and in the last race you have to race the new horses against the first three places A1, A2, A3 (possibly without knowing the order) of the $n$ horses that already have raced, otherwise you cannot determine the overall three fastest horses with the last race.
Hence $n=23$ or $n=24$.
If you assume $n=23$, then it is impossible to determine the three fastest horses out of 23 with 5 races:
You cannot have less than three different winners, since only two repetitions are allowed.
If you have three different winners that have not been compared, then any of the 5 second places could be A2 or A3.
If you have four or more different winners that have not been compared, all of them could be A1,A2, or A3.
If $n=24$, then you have to know a set of four horses out of the first 24 which contains A1,A2 and A3. But this is impossible in 5 races, since you have at least 4 different winners that have not been compared, and so these four horses and the second places could be all A1,A2 or A3.
Hence all cases lead to a contradiction, and so the assumption that 6 is enough, is untenable.