Who would invest $316 million in an obsolete red-brick factory in this depressed old industrial city? The General Electric Co. would.

From the outside, GE's sprawling, 350-acre locomotive works, which dates back to 1910, looks pretty much like hundreds of other factories around the Great Lakes that have been closed and abandoned. But inside, GE has undertaken a massive program, involving investment in automated machine tools and computerized processes and the retraining of employes, to convert the plant into what it calls "a factory with a future." The plan is to create a facility where all paper is replaced by electronics and, as one engineer said, "all routine decisions are made by the system itself."

GE, one of the world's largest industrial corporations, with 1982 sales of $26.5 billion, has committed itself to a long-term effort to upgrade and automate this old plant because it regards automation and maximum efficiency as the keys to survival.

Rather than bail out of an unglamorous, slow-growth industry and yield the market to foreign competition, GE has chosen to stay and fight. This is the battleground. The conversion to full automation will not be complete until late in this decade, but the potential gains in efficiency and productivity are already strikingly visible in the shop that turns out giant engine frames.

There, two workers operating nine automated, color-coordinated machine tools do in 16 hours what used to take 70 workers 16 days to do on 29 outmoded machines. One of the workers looks like a factory hand; he wears overalls and carries a wrench. The other sits in a booth above the shop floor, wearing a necktie, silently pushing buttons on a console.

This installation alone cost $16 million, but GE says it increased worker productivity by 240 percent, improved the quality of the product and expanded capacity by enabling more than one kind of frame at a time to be run through the assembly line. The computer manipulates the drilling and shaping machines according to the specifications of each of the giant frames, and the frames are transported automatically from one work station to another.

James A. Baker, executive vice president of GE's technical systems, said this type of automation is the "inevitable" byproduct of a determination to stay in business.

The factory here, he said, is "an old American business that decided a while back it wanted to stay in Erie, that it declined to be run out of business by Hitachi, or the French or anyone else, and it decided that the way to stay world-class competitive was not to whine and procrastinate and wait for better times and high volume, but to produce the world-class best locomotive at a competitive price."

In a larger sense, GE needs to succeed at modernizing this plant because it has developed a promising new line of business helping other corporations to modernize, preferably using GE equipment. If GE is able to modernize this and other old plants to the point that they are economically competitive in world markets, it will have created a powerful advertisment for its own expertise.

So far, Baker said, "American industry has done little or nothing to deserve" economic recovery. But, he also said he is encouraged by the growing response from customers "willing to be born again in the waters of electronics." The message to be learned from the locomotive plant, he said, is that "automation does work, that it's practical, that it can make old businesses tough and competitive, and that it's good for the country."

Capital investment on a scale GE has undertaken here--amounting to a retooling of the entire vast plant--requires faith that the major market for the product will grow. GE says it anticipates strong demand for locomotives from a vigorous railroad industry.

Carl J. Schlemmer, general manager of GE's transportation systems business division, said the railroads are prospering as a result of deregulation, mergers, new technology and a surge in the demand for coal. "Once the current recession is behind us," he said, "the growth in railroad traffic and the need to replace an aging fleet will generate a locomotive market significantly higher than the average market of the '70s."

Already this year, GE has received orders from Conrail for 60 locomotives and from the Burlington Northern line for 67. These substantial orders prompted the company to announce that 900 laid-off production workers will be recalled by the end of 1983.

Despite that announcement, which was welcome news in a city where the unemployment rate is about 19 percent, GE executives appear extremely sensitive about the employment implications of the automation program.

Joseph E. Podolsky, employe relations manager at the plant, said "the press tends to sensationalize" about potential job losses. He argued that the decline in the GE plant's work force from about 10,500 in 1980 to about 7,400 today is more the result of the recession than of automation.

In the long run, GE says, employment here will actually increase about 10 percent over current levels while automation will improve output by more than 30 percent, helping to ensure that the entire operation will survive.

The United Electrical Workers union, which represents most blue-collar workers here, has criticized layoffs at GE facilities here and the company's program to retrain workers for its automated assembly line. GE officials acknowledge that they phrase their answers to questions about employment to avoid arousing the union. And they go out of their way to cite the plant's "trained work force" as a major factor in their decision to stay here and uprgrade rather than build a new plant elsewhere.

"We would not be further ahead in a new location," Schlemmer said, "if we can get productivity up here and increase capacity without increasing space. The savings enable us to run this program out of this business. And here we have a trained labor force. We will have to do some training here, but we would have to do more anyplace else."

The only completely new building in this "factory with a future" is a $6 million "learning center," which is a euphemism for retraining center. There, in carpeted, brightly-lighted classrooms that stand in stark contrast to the gloom on the shop floor, workers learn how to operate much of the new equipment.

Schlemmer said the overall employe mix will gradually change to include more technicians and trained specialists and fewer manual workers. Already the automation program has transformed one grimy, dangerous operation--cutting parts out of steel plate--into a computer-driven, nearly silent process run by two workers.

This used to be done by individuals using templates, like tailors cutting fabric along a paper pattern. Now, computer-driven machines lift the two-ton plates from a storage center, move them onto a cutting line, immerse them in water and cut them according to computer-devised patterns. A high-speed plasma-arc burning system cuts parts out of two plates at once--underwater, to reduce heat loss. Another automated crane sorts and stacks the cut parts.

The computer calculates how to cut the parts so as to use the greatest possible amount of the steel in the plates. This system, GE says, is "the first in the world to link all elements from part design through plate burning, including material handling and information processing."

When fully installed, GE engineers say, the plasma-arc system will double part-cutting capacity, increase the accuracy of the cutting operation and minimize the waste of plate, without requiring additional workers.

Planning for the factory-wide changeover began in 1979. On a corkboard along a 100-foot wall, color-coded cards show the steps to be taken in each month through the end of 1985, and for each three-month period after that, into 1988. Each step--reduction of inventory, conversion of idle floor space to production, automation of industrial processes and computerized design of components--is being taken without interrupting current production.

"I have a terminal in my office," said Duane H. Shull, the engineer in charge of conversion program, "and I can see exactly, in detail, what we are supposed to do next week. At the end of the week, I can see whether we did it."

The "bottom line" at the end of the process, GE says, is "a 33 percent increase in capacity and a 20 percent reduction in materials cost, achieved with a 12 percent increase in floor space and a 10 percent increase in employment."