Mandelson is the ideal opponent for Livingstone. He is an establishment figure and so allows Ken to run as an outsider. At the same time, Mandelson doesn’t have the support or connections in the London Labour party that Ken has. In any primary contest against Mandelson, Livingstone could expect to win comfortably.
What Livingstone wants to avoid is a race against either David Lammy or Oona King. Livingstone fears that a race against either of them would be all about race or gender. And Livingstone, a practioner of identity politics, knows how divisive that could be.