It depends on how the win conditions are worded, but usually the mafia win when they equal or outnumber living townies (i.e. they control the vote and therefore cannot be voted off). So usually, the mafia would win in your scenario.
However, if the win condition required them to kill all townies, and the doctor can protect himself, the moderator could declare a draw as the game is stalemated. But I would say it would be considered bad practise to allow such a situation to occur.
However, if the win condition required them to kill all townies, and the doctor can protect himself, the moderator could declare a draw as the game is stalemated. But I would say it would be considered bad practise to allow such a situation to occur.