Chazon Ish (Y.D. siman 69) on the trolley problem:
C.I. distinguishes between the case of deflecting an arrow shot at a group so that it strikes an isolated individual (similar to redirecting the trolley away from a group at the cost of the life of an individual) from the case at the end of Terumos of handing over a single individual to be killed in order to spare the group. In the latter case, handing over an individual to be killed is an act tantamount to murder. It's the context which provides a justification. In the case of the arrow, deflecting the shot is not an act of murder -- it is an act that prevents harm. It's the context, the fact that is is being deflected at an individual, which transforms it into something else. The two cases are inverse of each other.