A superior court judge has denied a motion from 10 Oak Bluffs residents who are trying to block the town from using Community Preservation Act money to restore the stained glass windows at Trinity Methodist Church.

The residents argued that spending public money on church restoration was a violation of state and federal law. The town said the funding should be allowed because it would go toward historic preservation and not a religious mission.

The Hon. Richard T. Moses, an associate justice of the superior court, ruled against the motion for a preliminary injunction. “The court finds that there has been an insufficient showing of a likelihood of success on the merits and that granting of the injunction wouldn’t be in the public interest,” the judge wrote.

Notice of the decision was mailed on Monday.

Community Preservation Act funding comes from a surcharge of up to three per cent on property taxes to raise money for open space, historic preservation, affordable housing and outdoor recreation. The plaintiffs, led by resident Brian P. Hughes, claim this violates the Massachusetts constitution, which prohibits the state and towns from using public money to fund or maintain a charitable or religious undertaking, as well as the establishment clause of the First Amendment.

“There seems to be no end in sight,” Mr. Hughes said in an email to the Gazette last week. “One can imagine that eventually every old church in Massachusetts will seek to maintain its physical structure with public monies. There is a significant difference between a sectarian entity raising money voluntarily from the general public to preserve an historic church and compelling citizens to maintain a church through taxation.”

But town counsel argued that the money would be used to restore the building alone, which would serve a public purpose.

Community Preservation Act funding, which comes from a surcharge on property taxes, has been used by other Island towns and communities around the state for church restoration.

“We’re very pleased with the decision,” town attorney Ronald H. Rappaport told the Gazette Monday morning. “But I just want to be clear that there is a distinction between preservation of a historic building and promoting religion,” he said, adding:

“The Camp Ground is on the National Register of Historic Places and the Trinity Church is an integral part of the public’s enjoyment of that area.” He also said the Oak Bluffs community preservation committee and town meeting voters “recognized that . . . the exterior of the church is there for everyone to enjoy and what happens on the inside of the church, in terms of religious services, the town has nothing to do with.”

Mr. Hughes said he and the other plaintiffs have not had enough time to consider whether to appeal the judge’s ruling.

“Despite this ruling I still believe that the Massachusetts constitution prohibits using public money to repair church structures even under the guise of historic preservation,” he said in his email to the Gazette.

“From the beginning of this endeavor we knew that it was highly unlikely that the initial ruling, at the first judicial level, would upend the status quo. However, I believe that Judge Moses erred in his decision.”

Mr. Hughes said if the lawsuit had occurred closer to the Massachusetts Constitutional Convention of 1917 the result would have been different, since the convention overwhelmingly passed an anti-aid amendment to “prohibit forever [the] unseemly scramble for public spoils.”

“That ‘unseemly scramble’ has been renewed by the Community Preservation Act as implemented on the local level. Throughout the state, more than 140 times, churches have maintained their structures with public monies. The sums of money are staggering and ever increasing,” Mr. Hughes wrote.

He continued: “Whether or not we appeal the decision of Judge Moses, or other citizens carry this issue forward, I am confident that eventually the Massachusetts supreme court will concur with our position and eliminate the use of public CPA monies to maintain churches.”