I think this is a red herring all the way. Before you think about this problem, the first thing you have to ask yourself is: "Why do we have managers"?
Let's start a thought experiment. We'll start a company with one person. What will that person do? Manage? Of course not. There is nothing to manage, because there is only one person. Instead, although they have to plan and prioritise their work, if they aren't actually spending most of their time working, then nothing will get accomplished.
What if we have 2 people? Should we make one person a manger and have the other person do the work? Of course not. The manager will have virtually nothing to do while the working person will be overwhelmed. Although you may shift some responsibilities depending on who likes to do what, or who has various skills, unless both people are working then you will have lots of problems.
At what point do we need a manager? Well, we need a manager when the communication overhead and day-to-day chores impacts development. We only need that manager when there is enough work that they will be able to spend almost all of their day doing that work.
So what will they do? Basically anything that is stopping the workers from getting their job done. If there is a problem with communication, then the manager needs to organise things so that everybody has the information they need. If there is a lack of prioritisation, then the manager needs to prioritise/plan the work. If there is conflict on the team, the manager must find ways to resolve the conflict. I'll stop here as there isn't much point enumerating all the things a manager must manage.
The point is that everything a manager does is a result of coordinating large numbers of people or disparate information sources. Their job is to coordinate, prioritise, reduce conflict and communicate so that the workers can concentrate on getting their work done. The manager is there to "take one for the team" so that the team doesn't get embroiled in drama, trivia, or complications.
Getting back to the original problem: "you'll need to put the company first, team second and your team members third". Sorry to be rude, but that's just naive. Your function is not, through force of your will, to make all the workers do what the company wants. Your job is to coordinate information and reduce conflict so that the members can be successful. Your job would not exist if you did not have team members or teams.
And as impolite as this is, I can't finish without asking managers to contemplate the following: Is there more or less drama due to your actions? Are you demanding team members organise information for you, or are you organising information for the team members? Are you resolving conflict as it occurs, or are you creating conflicts in order to get your way? Do you ask your team to jump through hoops in order to solve a political problem, or do you jump through hoops to solve political problems for your team?
As an engineering manager, you can not succeed if the team does not succeed. It is true that your team can succeed for short periods even if some team members do not succeed, but it is an unsustainable condition. If your team members are not successful, then you have failed. <- Notice the full stop.