Solgaleo must have a small niche for what it's worth as it even has a D Rank. If it was outclassed by NDM in every way then there's no reason of ranking it. I will go through all the formats you said.
USUM AG / Ubers
Solgaleo does, however, boast a greater Speed stat than Necrozma-DM that is decent enough to utilize a Choice Scarf, allowing it to become a reasonable offensive check to Xerneas. This paired with its ability Full Metal Body also allows Solgaleo to retain its Speed against Sticky Webs teams.
With a Choice Scarf, Solgaleo is also a decent answer to cores that try to utilize Psychic Terrain such as Tapu Lele with Deoxys-A or Ultra Necrozma, as it resists both of Tapu Lele's STAB moves, is able to outpace both Deoxys-A and Ultra Necrozma, and OHKOes Deoxys-A and 2HKOes Ultra Necrozma with Sunsteel Strike.
Full Metal Body avoiding speed drop from Sticky Webs means that with a Choice Scarf it can be an average cleaner as well as beat weakened Xerneas.
There's also an Z-Splash set with Flame Charge, but it's only one time use, compared to NDM's Swords Dance and Rock Polish which it can easily pull off. So even this set is generally outclassed by NDM, and the best option to use it over NDM is as a Revenge killer with Scarf.
Solgaleo @ Choice Scarf
Ability: Full Metal Body
EVs: 252 Atk / 4 SpD / 252 Spe
Jolly Nature
- Sunsteel Strike
- Flare Blitz
- Earthquake
- Stone Edge / Wild Charge / Toxic
Source
SwSh Ubers
As a Xerneas check, while it lacks Rocks for sure, it has slightly higher bulk which means you can try a SpD set though NDM generally outclasses that because of also getting Stealth Rock and better ability to deal with Eternatus.
Calcs:
+2 252+ SpA Xerneas Thunder vs. 252 HP / 252+ SpD Solgaleo: 206-243 (43 - 50.8%) -- guaranteed 3HKO after Leftovers recovery
+2 252+ SpA Xerneas Thunder vs. 252 HP / 252+ SpD Necrozma-Dusk-Mane: 180-212 (45.2 - 53.2%) -- 0.4% chance to 2HKO after Leftovers recovery
Despite that, Prism Armor makes NDM much better as it can tank super effective hits from Eternatus better.
- 252 SpA Life Orb Eternatus Flamethrower vs. 252 HP / 252+ SpD Prism Armor Necrozma-Dusk-Mane: 142-168 (35.6 - 42.2%) -- 88.5% chance to 3HKO after Leftovers recovery
- 252 SpA Life Orb Eternatus Flamethrower vs. 252 HP / 252+ SpD Solgaleo: 216-255 (45.1 - 53.3%) -- 1.2% chance to 2HKO after Leftovers recovery
Therefore, SpD Solgaleo in Ubers is very niche but still can be used to some degree.
SwSh AG
In case of SS AG, Solgaleo is a Zacian-C check that is immune to Gothitelle. Full Metal Body prevents it from getting Charm-ed, and with Teleport it can escape Shadow Tag. Since Shadow Tag is banned from Ubers, it can only work in AG.
Still despite a slightly more bulk than NDM, the same issue as in SS Ubers: Lack of Prism Armor means Crunch Zacian-C which still not having much usage can just 2HKO, a thing Necro-DM can avoid thanks to taking less damage from Crunch.
Calcs:
- +1 252+ Atk Zacian-Crowned Crunch vs. 252 HP / 252+ Def Solgaleo: 242-286 (50.6 - 59.8%) -- 83.6% chance to 2HKO after Leftovers recovery
- +1 252+ Atk Zacian-Crowned Crunch vs. 252 HP / 252+ Def Prism Armor Necrozma-Dusk-Mane: 160-190 (40.2 - 47.7%) -- guaranteed 3HKO
Thankfully, Crunch has still not seen much usage and with Gothitelle rising in viability this set can work:
Solgaleo @ Heavy-Duty Boots
Ability: Full Metal Body
EVs: 252 HP / 252 Def / 4 SpD
Impish Nature
- Sunsteel Strike
- Knock Off
- Morning Sun
- Teleport
That's all, I hope this helps!