According to the graph, Brazil is a democracy since 1987. Actually, after the 1964 coup, our first civil president was appointed in 1985 but first general direct elections only occurred in 1989.
Brazil being Brazil, it's very hard to pick a number.
We can argue endlessly about what a mess the process was, and if the results did reflect the electors wishes. But the people did elect delegates, that met and decided on a president. Formally, that is a perfectly valid election (that started by 82, and only really ended in 87 - that's an entire mandate duration with the delegates not really deciding on it).