More than 30 years after Brazil’s junta left power, the consensus that the military should stay out of politics has been broken, amid widespread dissatisfaction with the political class after several years of corruption scandals and economic turmoil.