The Catalan side were worried the Argentine would miss El Clasico against Real Madrid on November 21 if he had been hit with a four-match ban since Barca's squad is already stretched.
Referee Carlos Del Cerro Grande said Mascherano was dismissed for directing an insult, common in Argentina, towards the linesman but Barca appealed saying it was said in passing.
The suspension means the defender will miss Barcelona's league matches against Getafe and Villarreal.
Barca have suffered a series of injuries to key players including Lionel Messi, Andres Iniesta and Rafinha.
The squad has also been hampered because the club have not been allowed to bring in players over the last two transfer windows due to a FIFA ban over the illegal signing of minors.
Source: Bloom Sports Desk, London