Machines are capable of what their design parameters allow or can be manipulated by a user to a accomplish. In the trolley problem, any outcome is not the fault of the trolley itself.
Funny as the mosquito example is, they aren't evil. Just as wolves aren't evil for hunting deer. Animals may not possess consciousness as you or I, they are alive and are driven by biological necessity. Machines on the other hand, aren't.