Because I've already played Sonic & All-Stars Racing Transformed and Mario Kart 8 to death on Wii U, now that I'm playing each game on a different platform (Mario Kart 8 Deluxe on Switch, Sonic & All-stars Racing Transformed on PC) I will make this into a little comparison review.
Graphics: Both games look good. The tracks have a lot going on in the backgrounds but I think moreso in the Sonic game. Both games keep a steady frame-rate at all times, it's really hard to pick which one looks better, so I'll say this one is a tie.
Music/sound: This one is a bit tricky. I don't often care about videogame music. Still, I get a nostalgic feeling when I hear the old Super Mario Bros. or The Legend Of Zelda music, but I usually disliked the music in most Sega games and most of it is still corny as hell when I hear it again in this game. Another thing the Sonic game has going against it is the annoying announcer. I recommend just going straight to the options menu and muting him asap. For this category, Mario Kart 8 Deluxe wins.
Roster: The Sonic game has a decent number of characters to choose from, but who cares about racing as "Football Manager" or "General Winter" from Company Of Heroes? Something that bugs me about the Sonic game is that my main character is AiAi, but when racing online no two people can pick the same character, so if someone picks AiAi before me then I'm stuck using someone else. I'd say Mario Kart 8 Deluxe wins this category, too. Link almost feels out of place in a kart racer, but everyone else on the roster blends in really well.
Tracks: The Sonic racer has only 20 tracks while Mario Kart 8 Deluxe has more than double that. While the Sonic racer has some really good tracks, it just feels like there aren't enough of them (even Mario Kart DS had more than 20 tracks). Mario Kart 8 Deluxe wins this category, even though it does have its fair share of boring tracks, the really good ones make up for it.
Multiplayer: Well, if you have enough players to play locally this could be a toss up as both games are fun, but if your only option is online multiplayer then Mario Kart 8 Deluxe wins easily as there are way more people playing at any time of day. I bought the Sonic game at launch on Wii U and even then I could never get into a full lobby of players online, and it's rare that I've been able to do it on Steam.
Overall racing: Very tough to choose a winner here. These are two of the best kart racers ever, as far as I'm concerned. The Sonic racer has a bit of a Diddy Kong Racing vibe, as you're going to be changing vehicles from karts, to boats, to planes. And as the name implies, the tracks transform during each lap so you're not driving the same route on every lap. It's a brilliant idea that I wish Nintendo had used in Mario Kart. There does seem to be a lack of shortcuts, though. There is also a career mode with missions that add a lot of replay value to the game for anyone who wants to play single player. Mario Kart 8 Deluxe on the other hand, is not very enjoyable to play alone (why don't they bring back mission mode from MK DS?)
So, kart racers are infamous for having rubber band AI that can really piss you off, so which of these does it worse? In Mario Kart 8 Deluxe if you're too far ahead of the guy in 2nd place, you should expect to get bombarded with shells, or lightning bolts or any other item that can screw you over just long enough for the 2nd place character to catch up to you. In the Sonic racer that isn't much an issue because the 2nd place racer will never be too far behind you. But the AI isn't cheap, so as long as you're good enough to get to 1st place, as long as you don't make any major mistakes you can expect a fair race. The Sonic game offers no equivalent of a blue shell, and that's not a bad thing, imo.
The difficulty level is a bit higher than Mario Kart's. At times, Sonic's "B level" (medium difficulty) is almost equal to Mario Kart's 150CC. But the AI racers in the Sonic racer never really feel unfair as far as item usage, and a couple of days ago I even got the achievement for winning a race without getting hit by any items. Just think about how low the odds of that ever happening in a Mario Kart race are... So this is definitely a category where Sonic's game wins.
So I guess adding up the categories would mean Mario Kart 8 Deluxe is the better kart racer, but I'm alternating between the two of them and there are times I'm playing MK8D and wishing I was playing Sonic and vice versa. The Sonic game really needed more tracks and a better selection of characters and it doesn't dethrone Mario as the king of kart racers, but it's a close #2.