HUNTINGTON, W.Va. (AP) _ Ryan Barr was only a few months old when his 17-year-old unmarried mother signed adoption papers in the parking lot of a fast food restaurant.

The same day, his mother's parents went to see the lawyers who arranged the adoption and demanded the child's return. The lawyers refused, and the infant's grandparents filed suit. ...........CORRECTIVE SENT January 7,1986 FOLLOWS............. (HUNTINGTON, W.Va.)The Associated Press erroneously reported Monday that Tammy Lemley was 17 years old when she signed adoption papers for her infant son, Ryan Barr, in the parking lot of a fast-food restaurant.

According to court records, Lemley first signed adoption papers a few days before her 18th birthday at the office of the adoptive parents' lawyers. She then signed more papers, at the lawyers' request, on her 18th birthday during the meeting in the parking lot. Despite rulings by the Ohio and West Virginia Supreme Courts, Ryan's adoptive parents, Gene and Anna Barr, have refused to relinquish custody of the boy, who is now 4 years old. ...........................................................................

When Ryan was 8 months old, a lower court in Ohio, across the Ohio River from Huntington, declared his adoption illegal. Four years later, the Ohio Supreme Court upheld the lower court's ruling and the West Virginia Supreme Court affirmed the decision.

Through it all, Gene and Anna Barr have refused to relinquish custody of Ryan, who will be 5 at the end of the month.

In November, after the high courts' rulings, the Barrs opened a public relations battle to keep Ryan. Newspaper ads featuring a smiling family portrait of the Barrs with Ryan and their three teen-age daughters began appearing. The ads solicited donations and signatures on a petition deploring the custody change as ''inhuman.''

About 200 people turned out in Charleston recently for a quarter-mile walk across the Capitol complex. Petitions bearing thousands of signatures were given to a state delegate, and a former Mrs. America, Debbie Wolfe, appealed for the courts to reconsider.

Judges of the Ohio and West Virginia supreme courts say the issue is not just Ryan Barr, but all other children who might be in the same situation.

''Although we may be able to untangle the legal skein, there may be no way to repair the damage the litigants have wreaked upon this child,'' wrote West Virginia Supreme Court Justice Richard Neely.

The courts say that Ryan - born Bobby Lee Nash Jr. in Lawrence County, Ohio, on Jan. 30, 1981 - was adopted illegally because his mother, Tammy Lemley of Proctorville, Ohio, was not given a required court hearing and her consent was given ''under duress.''

They also say the Barrs unnecessarily prolonged the proceedings for 21/2 years by concealing their identities from the courts.

Having lost all appeals, the Barrs now say Ryan has been with them too long to justify returning him to his biological mother.

''None of the courts have considered what's best for Ryan,'' said Barr, who works for the U.S. Army Corps of Engineers. ''Nobody's checked us out or checked them out to see who's the best parents. The one thing that I'm trying to make very clear is that what's important now is Ryan's best interests.''

Mrs. Barr says Ryan has suffered from nightmares and vomiting attacks. ''He knows something is going on,'' she said.

The Barrs and their supporters dismiss the court rulings as ''technicalities' ' and tell people the decisions threaten all private adoptions.

''No private adoption would be safe,'' said Virginia Booth, a friend of the Barrs who is helping to organize the petition drive. ''People who handle adoptions are only human, after all, and they make mistakes.''

The courts ruled that the action of the Barrs' lawyers was no trivial mistake. Ohio law requires that all adoptions taking place outside the direction of a state-approved social agency must be conducted under the supervision of a court, and that the natural parents must appear before a judge and be informed of their rights.

''Otherwise,'' wrote Judge Alice Robie Resnick of the 6th Ohio District Court of Appeals, ''children could be sold to the highest bidder and shuffled around like objects on an auction block.''

When Lemley signed the adoption papers in the parking lot, the lawyers gave her $400.

Barr says that was to cover her medical expenses. Lemley says she allowed herself to be talked into giving up a child she really wanted.

Her family says she has stopped giving interviews because of stories sympathetic to the adoptive parents. But she told the Huntington Herald- Dispatch last month that the child's father ''just kept nagging me'' to give up the child.

While the case made its way through Ohio courts, the Barrs' lawyers refused to identify the adoptive parents. After the lower court in Ohio ruled that the child had to be returned, the Barrs - still without revealing their identities - began adoption proceedings in West Virginia.

Barr claims that the family did not realize it was the target of the Lemleys' suit. But Tammy Lemley's sister, Connie, says the Barrs ''knew all along.''

The Barrs' argument that Ryan is better off in the only home he has ever known cannot be given legal standing, Neely said, because the Barrs chose to hide their identities.

''We cannot allow our laws and court system to become an instrument for the obstruction of justice,'' Neely said. ''Accordingly, we cannot tell the Lemleys that they cannot have the child because it is 'too late.'''