Neither are as fast as my friend Ryan after he got his new shoes. He was so fast. Like really really fast. But he got hit by a garbage truck and can't walk without a cane now. His mom works at Waffle House. His brother plays Fortnite on Switch.
Both can go faster than light and "therefore" break through dimensional thresholds or go backwards in time; at that point actual measurement is kinda pointless. However, Flash is bound to the Speedforce (of whatever dimension/timeline/etc he's in) and when that's shared with any other speedsters, he becomes less capable. Sonic does not seem to share this "weakness" therefore would be considered faster.
This is the same argument for why Superman is actually faster than Flash, too. And ignores the use of chaos emeralds.