as someone suggested below.
Your question is premised on a misunderstanding that the 22nd amendment means (and can only mean) one thing. Unfortunately, anything written with words is subject to multiple interpretations, including the constitution. It is the Supreme Court's job to interpret the constitution. When parties differ at to what the constitution means, the Supreme Court is the decider.
While I can't imagine the Supreme Court deciding the 22nd amendment can be interpreted to permit Trump a third term, even if it does interpret it that way, it isn't going against the 22nd amendment or ruling it unconstitutional. It is declaring how the words which make up the 22nd amendment are to be interpreted.
(They can rule against laws (both state and federal), since laws rank below the constitution - and lawmakers can make laws that conflict with the constitution, either because they are stubborn and don't like what the constitution says - or because they are misinterpreting it. Because the Constitution is the supreme law of the land, it wins over any law which conflicts with it.)