A master mechanic named Elijah G. Otis invented the elevator here in 1853, and for many of the 130 years since the Otis Elevator Co. was the city's largest employer.

But now the sprawling complex is quiet. By summer the last 227 employes will be laid off and Otis will be gone, leaving behind an acrimonious debate over whether it profited unfairly from $14 million in urban renewal grants by building a new factory that it cannot use and now wants to rent at a profit.

"If Otis leaves this city a little bloodied," Mayor Angelo Martinelli declared, "then I'll have accomplished what I set out to do.

"I'm a conservative Republican," he said. "Believe me, I think there's a place for profit. But what they have done is rape, pure and simple, at the taxpayers' expense."

In many ways, Otis' departure is a familiar story: an aging industrial facility, overtaken by new technology, shuts down in a depressed city. But it also raises the unusual question of whether a corporation, by accepting government money with a promise to expand, has any moral responsibility to stay in business.

The sloping land where the complex's ninth and newest building sits was a slum area until a now-defunct urban renewal program provided federal, state and local money for Yonkers to acquire and develop the property and sell it to Otis.

When the grants were awarded in 1972, company officials said they planned to increase their 1,300-member work force to more than 2,000. But that was before several events occurred that Otis officials say they could not have foreseen.

First, Otis was taken over by an international conglomerate, United Technologies Corp. Second, the demand for elevators plunged as the high-rise construction market went into a slump. And most important, the mechanical devices that Otis makes at the Yonkers plant, such as the "controller" and "selector" that tell the elevator where to stop, were being replaced by microprocessors.

Faced with decaying facilities, high union wages and a changing market, United Technologies announced last Thanksgiving that it was closing the plant. The Otis subsidiary will continue to make 20,000 elevators a year at 26 plants around the world, but not in Yonkers.

The shutdown has come as a severe blow to this New York City suburb, which has been in financial straits since it went into default in 1975 and had to be bailed out by the state. Martinelli has threatened to sue Otis, but the city's coffers are so bare that he is taking up collections from local unions, colleges and law firms.

The flamboyant Martinelli, whose printing business once stood on the Otis site, was one of the original opponents of the expansion. He went to court to block the federal grants as an unwarranted gift to a private company.

After spending $14 million to move 30 firms (including Martinelli's) and 350 families and demolish their buildings, the city sold the property to Otis for $1.3 million, which Martinelli contends was a fraction of its market value.

"We wouldn't have given them this money for them to go into the real estate business," he said. "They told me as late as January, 1982, that they were not closing the plant. They were lying through their teeth."

Otis officials, however, say they passed up a better property in New Jersey and undertook the $10 million expansion as a favor to Yonkers. "I don't think we would've spent $10 million if we didn't think we'd still be here," said plant manager William Drummond, who has worked here for 39 years.

Peter Thompson, a spokesman for United Technologies, said Otis never promised to remain open indefinitely when it accepted the grant.

"It was a business decision," he said of the shutdown. "We signed a contract and we fulfilled all our obligations. I don't think it's a moral question."

Federal officials offer a similar response.

"I do not believe the federal government has any continuing responsibility in this case," said Donald Dodge, a community planning official in the Department of Housing and Urban Development. "It is a local dispute. The city did benefit for the period of time the company was operating."

Martinelli insists the company could get major union concessions if it agreed to modernize the plant. He has vowed to stop Otis from leasing the 635,000 square feet of vacant space at the plant.

"If they have a company in mind, I'll try to talk them into going somewhere else," Martinelli said. "If Otis had gone out of business, it would be another matter. But they have dissipated their business and taken it all over the world."

"This is another emotional outburst by the mayor," Thompson responded. "He said he would do everything he could possibly do to embarrass United Technologies, and this is part of his campaign." CAPTION: Picture, Main Otis Elevator Co. plant was built with $14 million in urban renewal grants but the company is pulling out now and wants to rent it for profit. AP