In the first ethical scenario
The concept of utilitarianism can be used to explain the best course of action. The concept entails choosing actions that provide the greatest happiness to the largest number of people (Mill 338). It is therefore essential to pull the lever and save the lives of the many. The principle of sanctity of life is weaker compared to the principle of best consequence because the latter is concerned with the best achievable outcome. If the trolley crashed the five workers without the observer's knowledge, it would be a different case. However, confronted with the moral dilemma and being at a position to act, a quick judgment has to be made and for the greatest happiness.
The second ethical situation
The second ethical situation is different and requires a profound and thought out decision because instead of redirecting the harm, one is causing the harm. To save the lives of the five workers through pushing the large man to stop the trolley would be wrong even if it causes the greatest happiness. Pushing someone over the bridge is a violation of his right to life. Borrowing from Kantian ethics, pushing the big man is a means of achieving the end which is wrong when using an individual. Even if the goal of saving the five workers constituted a good reasoning, the best action would be to watch as the events unfold. Killing the big man in the second case is equally worse like letting the five workers die and hence, morally wrong. The different choices made in the two cases prove ethic implies constantly shifting between the principle of sanctity of life and the principle of the best consequence.
References
Mill, John Stuart. "Utilitarianism." Seven Masterpieces of Philosophy. Routledge, 2016. 338.