Carlos Tavares, who had been under fire and was expected to leave at the end of his contract, resigned abruptly on Sunday.