By Jonathan Stempel

NEW YORK (Reuters) - The future of an 80-acre New York apartment complex will be at stake on Thursday as a judge considers whether a venture led by a prominent hedge fund investor may conduct a foreclosure auction.

William Ackman's Pershing Square Capital Management LP and Boston-based Winthrop Realty Trust want control of the Stuyvesant Town and Peter Cooper Village complex, which is home to more than 25,000 residents.

Their PSW NYC LLC venture is pressing to foreclose on equity in the property's owner, after having bought a defaulted $300 million mezzanine loan for 15 cents on the dollar.

They are opposed by holders of a $3 billion senior mortgage represented by two of the largest U.S. lenders acting as trustees, Bank of America Corp and US Bancorp.

New York State Supreme Court Justice Richard Lowe will hear arguments in the case on Thursday. He delayed PSW's planned auction from August 25.

Long a bastion for middle-class residents in pricey Manhattan, the housing complex includes 11,227 apartments in 56 buildings.

A group led by Tishman Speyer Properties LP bought it for a record $5.4 billion in 2006, but worsening market conditions have since caused the property to lose half or more of its value.

The group stopped payments on the first mortgage in January after New York's top court stopped it from imposing big rent hikes. Tenants have their own plans to restructure the property and keep it affordable.

Ackman has turned his attention recently to commercial real estate, having parlayed a $25 million investment in General Growth Properties Inc into a stake likely worth well over $1 billion when the mall operator emerges from bankruptcy protection, which could occur as early as October.

CREDITORS FIRST?

In the Stuyvesant Town case, Bank of America and US Bancorp say Pershing and Winthrop must first pay the senior creditors $3.66 billion, representing principal due plus interest and penalties, before possibly taking control of the property.

They fear a bankruptcy filing that could saddle those senior lenders with big losses.

"Senior lenders have every legal right to foreclose, but in practice they don't want to because they have to pay millions of dollars of transfer taxes, and still need someone to buy and manage the property," said Ben Thypin, senior market analyst at Real Capital Analytics Inc, a real estate research firm.

"It will take months, if not quarters, to resolve this," he said. "The most likely scenario is an equity foreclosure by the mezzanine lenders, after they agree with the senior lenders to modify terms of the senior loan. No one could buy the property with the $3 billion loan at the current terms."

CWCapital Asset Management LLC, a special servicer overseeing the complex, had planned to foreclose on the property in the second half of September.

But in an August 27 court filing, PSW said such an auction could wipe out its investment. It also said creditors have not shown that an existing intercreditor agreement prohibits it from foreclosing on the equity.

The trustees countered on Tuesday that "in every relevant respect," the senior lenders have greater rights than PSW.

The case is Bank of America NA et al v. PSW NYC LLC, New York State Supreme Court, New York County, No. 651293/2010.

(Reporting by Jonathan Stempel in New York, editing by Matthew Lewis)