It doesn't really work that way, but I'll take your top level concern in good faith. If faced with a trolly problem, the AI will act how it was trained to act. The correct answer isn't even obvious to humans. There should be a conversation.