It's an interesting question, and I'm going to take this opportunity to explore my reasoning. It will look like I am working and thus I will not need to be accountable to my irl responsibilities for the time I spend typing on a computer.
The snap judgment answer would be that Super Mario Galaxy is far superior to Super Mario Odyssey, while not diminishing the latter in the comparison.
My personal taste in Mario games is this: I want to have courses that are elegantly designed, creative, and challenging to adults while also not being off-putting to children, AND AT THE SAME TIME, be able to explore and discover hidden things. That's a pretty impossible standard, I admit! But it's a standard that Nintendo themselves have set; a prison of great expectations that comes with the earned pedigree of the Super Mario series.
In that sense, Galaxy is unsurpassed with walking that fine balance in the most graceful way imaginable. Super Mario Galaxy is my absolute favorite in the series (along with Galaxy 2 which I think could be considered a "& Knuckles"-like expansion pack) in terms of the course design, the missions, and especially the challenging post-game stars like the Purple Coin quests which, despite initially seeming like filler content, ended up being some of the most enjoyable parts of the overall game.
On the other hand, Super Mario Odyssey is packed with more post-game content than any other Mario game before it, with more collectable moons and coins than seems realistically possible. The game worlds encourage exploration, which is fun, even if it is especially limited in comparison to the exploration of Breath of the Wild, which came out around the same time. While Cappy is more central to Odyssey's central concept, it's not terribly dissimilar to the transform mushrooms from the Galaxy games (or even 3D World in parts), and so Cappy feels perhaps less exciting than it might, had "Mario turns into X" not already been on its way to becoming as central to Mario's 3D control identity like how wall-jumping and butt-stomping have become standard in Mario's moveset (post-Super Mario 64.)
HOWEVER.
All of this overlooks the major flaw in Super Mario Galaxy -- it is not available to play without a Wii remote.
Nor is Galaxy available in HD, and obviously it is not available (yet?) on the Nintendo Switch. The reality is that these games do not exist in a canonical void where both can be played on equal terrain, aside from in our collective memory and imagination.
Unfortunately, this must drag down Galaxy from the consideration, because to actually play the game today, requires several pieces of out-of-date & largely unsupported hardware just to experience a game that will look quite jaggy on most modern television outputs. The best way to play would be via emulation, which is difficult and generally illegal in most instances, so the best way is not advised. The second best way would be to connect it to a SDTV, where the graphics' jagginess are smoothed out a bit and the game is played on the hardware that it was intended for.
Let's say you do all of this. Imagine you are coming to Mario Galaxy for the very first time, because of it's status as "one of the greatest games of all time" which as I elaborated above, it truly is deserving of that praise, if it holds up to my memory of the experience in the context of its time.
You then are tasked with one additional barrier of entry -- learning to use the Wii remote and nunchuk controllers. Now even people who didn't own a Wii still played it at least a bit at some point somewhere -- famously even your grandmas were playing it -- so most likely it is not a completely foreign object in 2018 or 2019. But it is not the most intuitive controller ever made. It takes a bit of getting used to, if you are say 8 or 10 years old right now. Pointing, waggling, and coordinating the new spherical world and the different gravity effects -- it's a lot!
Now, all of that precision necessary is part of what makes the game great, also. The game was praised specifically at the time because of how well it proved the concept of the Wiimote/nunchuck for 3D action gameplay that integrated the pointer, the motions, and the nunchuck. Incidentally, Resident Evil 4: Wii Edition was also praised a lot for these same innovations. But unlike RE4, which is available on enough devices that you can play it with any controller, Mario Galaxy insists that you play it with a Wiimote and nunchuk. Two additional pieces of plastic, in addition to the two massive pieces of plastic that constitute the Wii U, just to play the damn thing.
In that context, Mario Galaxy does not hold up. I would not recommend it as being worth the effort. Unless you already happen to have a Wii U, in which case you likely also had a Wii, in which case you are like me, and you've already played this game in the original context, and so the game is better left served as a memory anyway.
On the other hand, some people like to get into game consoles a generation late. This is the best decision by far from an economical point of view. Everything is discounted, and everything is already available. The system has already established it's top 10, top 50 games to play. All you have to do then is to enjoy the experience, albeit one that is a bit out of sync with the outside world, but if you don't care about video game FOMO, then this is objectively the most rational way to experience video games - with patience, and reasonable expectations that this is a hobby for entertainment, it is an art form, and it is full of life created by artists and developers to communicate a specific experience for you. In this context, when the gaming year of 2007 is happening for you in 2019, then Mario Galaxy reigns supreme again, because you've committed to the Wii-mote controller for this to be a primary device for your gaming.
But for myself, or anyone else that has shelved (but not sold) the Wii and Wii U in favor of Switch, SNES Classic, and an HD console, then the default answer must be Super Mario Odyssey simply because it is the one that is here now.
Mario Odyssey is great on its own merits. I suspect that if Galaxy & Galaxy 2 were to be given the 'deluxe' treatment in 2019, with an HD upgrade, and you can use the Pro Controller and turn off motion and the pointer, then once again Galaxy is king. Until that happens, if ever, then Mario Odyssey is the better choice, with everything considered.
TL; DR -- omg SMG 1&2 HD on switch plzzzz