Even if Mamdami didn't believe that, it would still be the smart thing to say. Elections are a popularity competition, there's no prize for saying the truth; just ask a climate scientist. The point is to change things.
It's important to get out of the liberalist mindset of thinking electoralism (here and now) should be about honestly stating every policy and correct position. We don't live in a marketplace of ideas where simply being correct is worth anything. If the bulk of the population isn't on board with socialism, then an election seat is either useful for milquetoast mild reform or for propaganda platforming (e.g. Sanders making "socialism" a more approachable idea despite Sanders clearly contradicting socialism in many other statements).