From the facts. draw your own inferences. I'm not a doctor, but I'm related to a bunch.
The article mentions Meb K. saying that Ryan had lost a lot of weight and was training very hard for the trials. That means he probably had vitamin and mineral deficiencies which aggravated his enlarged heart.
Also, his father mentioning that his son mentioned he may need a pacemaker demonstrates the Doctor's at the time thought he had a persistent irregular heartbeat.
Why then did the defibrillation and CPR not work?
Not only did he have an enlarged heart he must of had a congenital heart defect, like a faulty valve. Which would not be detected upon an initial screening, further tests are needed. A person can get an enlarged heart (besides from alcohol and cocaine abuse) when the heart has to overwork when there is some underlying defect i.e. a bad valve.
This kind of thing is more common than people think, (jim fixx?) odds of happening 1 in 280,000.
Why during the race? and not in practice?
Electrophysiologic changes brought by exercise are enhanced by emotion and competitive stress. The release of a lot more catecholamines stimulates the heart rate, myocardial contractility, blood pressure and oxygen consumption of the heart. These changes can perturb underlying myocardial ischemia and trigger a variety of cardiac arrhythmias if a pre-existing abnormality is present, such as an enlarged heart. This arrhythmia with a bad valve spelled disaster.
Most likely he fell unconscious first because his heart stopped sending blood to the brain with enough oxygen since the arrhythmia would make getting enough oxygen there too difficult.