Neither, really. Sonia appears in Sonic Underground, a separate continuity from the games, and she has never met Shadow at all.
Her connection to Knuckles is best described as friendship rather than romance. Because she exists outside the main game canon, questions about her relationships with game characters don't have a canonical answer — it comes down to fan interpretation.