A loose pass from the Manchester United defender led to Mexico's first goal after just 29 seconds. Brazil struggled to bounce back from the early blow and conceded a second goal in 74 minutes.
Porto striker Hulk pulled one back in injury time but it was not enough for Brazil who have won the World Cup five times but never the Olympic gold.
The Brazilian Football Confederation on Sunday singled out 21-year old Rafael for criticism on its website, saying:
"Right-back Rafael knows he made a mistake that led to the first Mexican goal in the Olympic football final in the London 2012 Games.
"There's no denying it. Nevertheless, with his skill and determination, the young No. 2 can't be tainted by the error.
"Mistakes are for correcting. Rafael knows that. Later, when things have calmed down, he will surely look at the move and learn from it. At the end of the day, as the saying goes, to err is human and we learn from our mistakes."
The criticism from officials contrasts with that of players and coaches, most of whom defended the youngster.
Coach Mano Menezes pointed out that Brazil had 89 minutes to level the match and could not, while forward Neymar said every player, including himself, shared responsibility for the defeat.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.