You have a point: an ethical dilemma is an ethical dilemma even if it is entirely imaginary. But when you discuss the trolley car problem in freshman philosophy you are, I assume, trying to imagine that there are real lives at stake, and that it would be a tragedy for them to be lost. In other words, you are analyzing the problem as if it were real. I don't think you would answer the trolley car problem with, "Can I kill them all, and take their stuff?"
Is that right?
If so, that seems to conflict with the sentiments you express about RPG violence: that since it is make-believe violence it doesn't really matter.
(As an aside, a version of the trolley car problem is now appearing in real life in autonomous car design, in the sense of balancing the life of the occupants of the car versus the lives of others. One company...I think it was Mercedes...got in some hot water for publicly stating how its algorithms would make those decisions.)
Honestly, I haven't seen that adventure since the early 80's so I don't remember the specifics. Is it like the trolley car, in that there is no answer that avoids killing innocents? Or can you choose to put your character at risk to save the innocents? If the latter, that's usually what I'd do. To a much greater extent than I fear I would in real life.
Again, a fair question to ask. As DM, though, I don't feel that my NPCs "are me" in the sense that a PC is. I have no more trouble portraying evil NPCs (to be slaughtered by the heroes) than I would putting an evil villain in a story I might write. But I can't imagine writing a story in which the protagonist/hero is evil. Struggling with inner conflict, and as a consequence doing not nice things or making unwise decisions? Sure. But slaughtering innocents, no.
So I find your question "are you not roleplaying your character?" odd. It's precisely because I am roleplaying my character that I find in-game violence disturbing.
I think a key difference though is the trolley car problem asks students what they would do, RPGs are asking what the character would do. And the reason it matters in the trolley car problem is because it reveals something about how we value human life. But let’s be clear: the trolley car problem is still just a thought exercise. It still is imaginary.
That said how Rob reacts to the trolley car problem is very different from how Rob’s C/E barbarian reacts to the Orc dilemma.
Either way, I don’t think there is much of a connection with role playing violence and real world violence