More than half of Prince George's County ninth graders last spring flunked a state writing test they eventually must pass in order to graduate from high school, but the results represented a slight improvement over an earlier unofficial test, county educators said yesterday.

Fifty-four percent of the 8,375 students who took the exam failed, compared with a statewide failure rate of 49 percent and a Montgomery County average of 34 percent. In an earlier "no fault" version of the test, 57.4 percent of county ninth graders flunked.

Students at Surrattsville High in Clinton performed the best -- with 34.2 percent failing -- while students at DuVal High School in Lanham performed the worst, with 74.7 percent failing. Students at Eleanor Roosevelt High School, the county's academic magnet school, did fourth best among the 20 schools tested, with 40.1 percent failing. At Walt Whitman High School in Bethesda, a Montgomery County school sometimes compared to Eleanor Roosevelt, 30 percent of the students failed.

"We're constantly being compared to Montgomery County," said School Superintendent John A. Murphy, who is beginning his first academic year in the post. "I'm hoping in a few years, they'll be compared to us."

In Montgomery County, "they have a very homogenous, stable population," Prince George's school spokesman Brian Porter said. "We're very heterogeneous and are all over the place with mobility, ethnicity and economics."

Unlike their Montgomery County counterparts last week, Prince George's officials provided no ethnic or sexual breakdowns of the results, and the scores as released appeared to bear no correlation to racial percentages.

Prince George's students, like other students around the state, must pass proficiency tests in reading, writing, citizenship and math in order to graduate.

In their first official writing test, administered in April, students were required to write a paragraph describing for their teacher an unforgettable event and a business letter to the principal asking for permission to hold a spring fair at school and explaining "what your class plans to do."

Readers for a North Carolina educational testing firm then evaluated each essay for content, organization, sentence formation, spelling, punctuation and grammar.

The testing coincides with heightened interest in the county system and nationwide in steering the teaching of writing away from the formalities of spelling and syntax and toward the process of outlining and organizing the writer's thoughts.

"In the '60s, it was, 'Express yourself,' " said Louise F. Waynant, assistant superintendent for instruction and pupil services, at a press conference called to discuss the writing scores. "Now, we're talking about a structural process . . . .We're not saying spelling and grammar are not important. What we're saying is spelling and grammar alone won't do it for you."

Eremein Jackson, a Prince George's supervisor of English language arts, said county officials will be looking for new textbooks "that reflect the new philosophy of writing. . . . It's on the front burner now. It's just becoming a big item. Everyone's talking about it."

School board officials said they also hope to incorporate computerized word processers into the writing program.

In discussing the test results, Prince George's school administrators cited mobility as perhaps the most obvious factor in disparate test scores. Surrattsville and Bowie, the schools scoring highest in the writing test, had the lowest turnover rates, 16.9 and 17.2 percent in 1982-83, respectively.

John A. Hagan, Bowie's principal, said his students' success also could be attributed to a weekly writing requirement in every class, including gym, that he instituted last fall. His students also tend to do well on standardized tests in the elementary feeder schools before entering Bowie, he added.