Employees at Brazil’s mining giant Vale SA and its contract safety inspectors knew for months of dangerous conditions at the mine-waste dam that collapsed last month.

Yet inspectors certified the dam as safe, expressing worry about losing contracts with Vale, the dam owner and a major client, according to police, government prosecutors, court documents, arrest warrants and people familiar with the matter.

On...