What do you do with the case where you have a choice between a train staying on track and killing one person, or going off track and killing everybody else?
Like others have said, you are oversimplifying things. It sounds like you just discovered philosophy or religion, or both.
Since you have referenced the Bible: the story of the tree of good and evil, specifically Genesis 2:17, is often interpreted to mean that man died the moment he ate from the tree and tried to pursue its own righteousness. That is, discerning good from evil is God's department, not man's. So whether there is an objective good/evil is a different question from whether that knowledge is available to the human brain. And, pulling from the many examples in philosophy, it doesn't appear to be. This is also part of the reason why people argue that a law perfectly enforced by an AI would be absolutely terrible for societies; the (human) law must inherently allow ambiguity and the grace of a judge because any attempt at an "objective" human law inevitably results in tyranny/hell.