SÃO PAULO—Brazil’s state-controlled oil giant, Petrobras, said it would end its yearslong policy to peg the cost of fuel to international prices, dealing a blow to investors as the leftist government of President Luiz Inácio Lula da Silva looks to control inflation. Petróleo Brasileiro, known as …