Trump is deeply corrupt. He cares a lot about his own wealth, image and brand and and very little about Christofascism or the US Imperial project.
Mamdani is mayor of NYC, where Trump came up and is still heavily invested (Trump Tower is in NY).
I think it's very possible that Trump sees much greater benefit in having a strong personal relationship with the overwhelmingly popular mayor of NYC than in trying to burn him down for the sake of empire, party politics or class solidarity. Getting on with each other also enhances both of their reputations' as 'political outsiders', helping distance themselves from heir deeply unpopular parties and strengthen their personal brands.
I wouldn't have expected this at all but in hindsight this makes a surprising amount of sense from Trump's perspective and obviously Mamdani (who isn't relying on the support of never Trump Blue MAGA democrats) will benefit greatly from not being obstructed federally.