RIO DE JANEIRO — It washed ashore in early September, thick globs of oil that appeared from out of nowhere and defied explanation. In the weeks since, the mysterious sludge, the largest spill in Brazil’s history, has tarred more than 1,000 miles of shoreline, polluted some of the country’s most beautiful beaches and killed all sorts of marine life.