Mahdavikia, who was playing his first match after joining Steel Azin from Eintracht Frankfurt last week, was sent off by referee Saeid Bakhshizadeh following his protest to the assistant referee.
Steel Azin lost 3-2 to Foolad in the match held at the Ekbatan Stadium.
In the IPL standings, Steel Azin is fifth with 39 points and Foolad sits 15th with 28 points.