Bernie Sanders would not have defeated Donald Trump in the election for the presidential post. This is because people are not fond of Bernie Sanders and he was also against Hillary Clinton. The public would have preferred Donald Trump to Bernie Sander. The other thing is that he is not that famous and has few leadership skills.
Anything is possible, but I don't think he could have gathered enough Dems and moderates to defeat any GOP candidate, let alone Trump. He did tap into some of the same anger and marginalization that Trump did, but he didn't have the larger party support. I don't see the larger party supporting him the way the GOP did trump.
Bernie Sanders had some good things going for him that Clinton did not. He wanted to help out the lower class, and he was not a Clinton, He was not a Washington insider. But he was a socialist's wet dream and that would not work for everyone. Donald Trump was also more familiar.
There is no way on earth that Bernie Sanders would have defeated Donald Trump and the general presidential election. If this current election has Shaun one thing, it is that liberalism was unequivocally rejected. It stands to reason that Marxism would have been defeated even worse. Thank goodness Donald Trump beat both Hillary and Bernie.