The clash at the Maracana had been thrown into doubt over a lack of required safety reports for the stadium, but the court order has since been overturned
Judge Adriana Costa dos Santos had declared the game at the newly renovated stadium could not go ahead due to the lack of a number of safety reports required.
But the Rio de Janeiro state government insisted the Maracana had met all requirements and attributed the issue to a "bureaucratic misunderstanding."
And officials in Rio have since confirmed the friendly will now go ahead as originally planned on Sunday.
"The match between Brazil and England is confirmed for June 2, in accordance to all safety conditions", said the statement on Friday morning.
The England squad had already travelled to Brazil prior to the game, following the 1-1 draw with the Republic of Ireland at Wembley on Wednesday.