The case has spurred outrage among Mexicans, who viewed it as another instance of impunity for wealthy men.
The victim, who was 17 at the time of the alleged crime in January 2015, testified that she was forced into a car in the eastern state of Veracruz by four young men who began to sexually assault her.
She testified she was then taken to a home and raped.
On March 22, Judge Anuar Gonzalez dismissed pedophilia charges against one of the defendants, arguing that "an incidental rubbing would not be considered a sexual act without an element of intention to satisfy a sexual desire."
He also argued that the victim was not "defenseless" because she could have moved away from the defendant and noted that the prosecution failed to prove his conduct was "lascivious."
On Tuesday, the Veracruz state attorney general said it would appeal against the decision, noting that it "strongly disagrees" with the ruling.
It also said the case's dismissal was subject to review by another court and that the decision did not imply that the defendant, who maintains his innocence, would be freed.
The case has drawn widespread media attention, with the four defendants earning the nicknames "Los Porky's," in reference to a 1980s movie about teenagers trying to help a friend lose his virginity.
The ruling spurred anger across social media and fueled the creation of a twitter hashtag that translates to "Judge Porky."
(Reporting by Lizbeth Diaz and Alexandra Alper, Editing by Paul Tait)
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)