It's one of the classic debates among Sonic fans, but if it comes down to a straight foot race, the answer is Sonic.
While Shadow is fast and more than a match for Sonic in a fight, Sonic's whole identity is built around being the fastest thing alive. When the finish line is all that matters, the blue blur edges it out.