So it is true that for the most part there is a clear answer to the Trolley Problem for each of the nine alignments in D&D. And what a player should do is have some clear understanding of what he wants to explore with respect to a character that answers the Trolley Problem in a particular way, even if that character has a very different answer than their own. They should clarify with the DM if they have some question how a particular alignment addresses the Trolley Problem, and then play that alignment. And what will happen in game is that there will be external game RP as characters with different takes on the Trolley Problem face the Trolley Problem and there will hopefully in good harmonious functional RP around debating the Trolley Problem from the standpoint of the characters.
Really advanced RP happens when the player imagining the character with a ready answer to the Trolley Problem decides that based on RP the character himself decides that his own read answers were maybe incorrect, or that the player decides the character decides for whatever reason to against his own beliefs and leans into that and you RP out either remorse and guilt or else epiphany and character transformation.
Now the problem you run into is players take their own biases about the Trolley problem into the game rather than the character's biases. And rather than RPing in a functional and mature manner, they get all offended that someone's character addresses the Trolley Problem differently than how they think it should be in real life and then you have antagonistic non-harmonious RP. But that's gonna happen with immature dysfunctional players whether you have alignment or not.
Now I can tell you right now how players that hate alignment want the Trolley Problem solved in game. They want it solved with "Whatever helps the party win. Stop worrying about moral predicaments and just metagame. Be practical. Be ruthless. Don't let the DM keep you from winning."