BRASÍLIA—Brazil’s president, Michel Temer, has been called a coup plotter, charged with corruption and is highly unpopular with voters.

But as Mr. Temer prepares to leave politics after national elections in October, many economists credit him with taming his country’s high inflation, reviving private investment with business-friendly policies and pulling the country out of a steep recession.

There’s...