After a corruption scandal toppled the countrys last leader and fueled voter outrage, a former TV comedian with no experience in government was poised to win