For a while, it seemed as if the new year would be anything but happy for the members of St. James Episcopal Church in Prospect Park.

The 106-year-old Delaware County congregation was so mired in debt that it couldn't pay its rector. Closing seemed imminent.

Just 10 minutes away, in Ridley Township, Leiper Presbyterian Church faced a different challenge: a small, aging membership, with only 30 coming to Sunday services.

Leiper, founded in 1818, voted to dissolve, an acknowledgment of hurdles too steep to overcome. Its last service will be at 2 p.m. Sunday.

St. James fought and survived - for now. It will install a part-time rector Jan. 28.

While the public eye is focused on the troubles of the Roman Catholic Archdiocese of Philadelphia - which announced Friday that it would close four high schools, and shutter or merge 44 elementary schools - the struggles of St. James Episcopal and Leiper Presbyterian are illustrative of the demographic trends that likewise have battered mainline Protestant congregations.

"Across the board, it's increasingly tough sledding," said David Roozen, director of the Hartford Institute for Religion Research, which studies trends in faith life.

The congregations often face dwindling membership and aging buildings. Finances are shrinking, no thanks to the floundering economy, and that hinders the offering of programming that can attract young families, Roozen said.

Over the last five years, six churches in the Episcopal Diocese of Pennsylvania, and five in the Presbytery of Philadelphia (Presbyterian Church USA), have closed or merged. The Southeastern Pennsylvania Synod of the Evangelical Lutheran Church in America has had three mergers and six closings. Parishes in the Philadelphia Archdiocese have declined from 302 in 1990 to 266.

For St. James, the alarm bells began sounding three years ago.

The church of 75 families had to fix its boiler system and make other repairs to its 102-year-old stone building.

The congregation had lost members, who took their tithes with them. Those who remained were not able to give as much as they once did, said Dottie Paullin, the church's senior warden.

Eventually, St. James could not pay its rector. It had bills of $12,000 - and $110 in the bank.

At Leiper Presbyterian, part of the Presbytery of Philadelphia, the problems were more about shifting geographic patterns than money, said the Rev. William Caraher, pastor since 2002.

Leiper is one of as many as a half-dozen Presbyterian churches within a five-mile radius, in a community that has become increasingly Catholic, Caraher said.

Founded by the Scottish tobacco merchant and quarry owner Thomas Leiper as a chapel for his employees, the church has just 31 families. Most members are older and contemplating moving away to retirement communities.

"We've known we were going to have to make a decision a year ago," Caraher said.

"The church of Jesus Christ goes on, and every congregation isn't meant to live forever."

The members voted Nov. 20 to dissolve.

But for the people of St. James, that was not an option.

In August, the Rev. William Hesse told his congregation he was taking a post in Georgia. He also said the church would likely shut down.

The Rev. E. Edward Shiley, former dean of the Episcopal churches in Delaware County, described the situation then as critical.

"Each parish has got to meet its own operating budget," he said.

At a September meeting, members asked Shiley for 30 days to come up with $20,000. "I told them, if you can do it, God bless you," he said.

The congregation not only had to raise money to pay back salary and other bills, but generate donation pledges totaling $1,600 a week.

As word spread about St. James' circumstances, help came from current and former members, as well as outside the church walls.

Donations ranged from $2 to $4,000. To date, more than $24,000 has been raised.

On Jan. 28, the Rt. Rev. Rodney R. Michel, assisting bishop of the diocese, will officiate at a service to recognize the Rev. John Wallace as the church's part-time rector.

At Leiper, though Caraher will deliver the congregation's final sermon Sunday, the building's life as a church is not over. A branch of the evangelical Blue Route Vineyard Church, based in Media, has been sharing the space with Leiper since October and will continue to use the building.

"The last thing we wanted is to see our doors close," Caraher said, "but it's really not going to. It will take on a whole new life."