Mandarins tend to want to keep their jobs, and are adept at serving political masters of any hue. Look at Sir Humphrey for examples of how to be totally neutral by believing in nothing at all, and by being able to argue both sides of a case perfectly. Yes Minister and Yes Prime Minister really ought be shown more often.
What is more interesting is the scope granted to "special advisers" to be placed within the Whitehall/Westminster machinery. This was a big change in the New Labour years, and I always felt it was indicative of Labour's inability to work with the administration - and lead to their legacy being style over substance and a series of very iffy judgements.
I'm not sure the current Govt is any better though. I think the country is sorely in need of people who can execute plans properly. Harnessing the skills of a functioning Whitehall before they vanish (which they will, in 10-15 years) would e a good place to start.