to lose (or to win) by a small margin, as in 1/100th of a second.
The other swimmer was phelpsed by the taller, faster one.