The central defender rose at the near post to beat Argentina keeper Sergio Romero to a Neymar corner and head home the winner, deciding a game that was set to go to penalties to determine the outcome.
Argentina is one of only two teams to have beaten Brazil since Tite took over as coach in 2016, but without Lionel Messi, who is taking a sabbatical from international football, it rarely troubled its neighbour in a derby match dubbed the Superclasico.
The game was played in the heat of the King Abdullah Sports City and the conditions contributed to a stop-start encounter that included 35 fouls, 21 of them awarded to Brazil.
Miranda should have put Brazil 1-0 up in the 28th minute when a Casemiro cross fell to him just metres from goal, but his scuffed shot was blocked on the line by Nicolas Otamendi.
Paulo Dybala went close with a swerving free kick for Argentina from just outside the box a minute later and Leandro Paredes watched a long-range effort drift just wide early in the second half.
Argentina improved considerably after the break, but Brazil still had the better chances, with Romero parrying away a fierce volley from Arthur after 70 minutes and Casemiro almost grabbing the winner with seven minutes left.