There are many such hypothetical scenarios based on the trolley problem, but the real answer is that a good self driving system will never end up in that situation in the first place.
So as a dev, you just program to not let that situation arise, then you won't need to program a solution for that.
Close to 15% India's energy needs already being met with solar. What do you mean "why not invest"?