Rebounding from a $460 million net loss in 1986 (due primarily to a $945 million restructuring charge that year) Union Pacific Corp. logged rec-ord earnings of $583 million in 1987 as management cut costs and positioned the diversified transportation, energy and real estate company for even further gains in 1988.

"We are looking to the future with great optimism," said UPC Chairman Drew Lewis in the company's 1987 annual report published this week."We feel our basic businesses are sound, cost-competitive, and well-managed. We feel we are investing in economically resilient ventures, which will enhance shareholder value."

Lewis, former U.S. Secretary of Transportation under President Reagan, took the Union Pacific helm last year following the retirement of Bill Cook whom Lewis credits with creating the company's vast cost-cutting program and restructuring of its strategic direction.

"The corporation is shifting from a very basic asset-oriented company, concentrating on the railroad and natural resource businesses, to a corporation determined to be on the leading edge of technology in delivering . . . transportation services, environmental services, creative oil and gas exploration programs and profitable real estate ventures," said Lewis in his chairman's letter to shareholders.

UPC reported consolidated net income of $583 million ($5.10 per share) for 1987, compared to a net loss of $460 million ($4.56 per share) in 1986. Earnings before a $945 million after-tax restructuring in '86 were $485 million ($4.20 per share).

Earnings before special items and with the restructuring excluded rose 16 percent to $560 million ($4.90 per share) last year over '86 with strong performances in the railroad and energy divisions accounting for most of the gain.

Lewis said the railroad continues to have cost-reduction opportunities that will make it more competitive, and UPC's natural resource company, Union Pacific Resources (a consolidation of Champlin Petroleum and Rocky Mountain Energy) was successful last year despite being continually subject to what he terms "the whims of OPEC pricing."

"Long term," Lewis said, "we are bullish on the oil and gas business. Short-term, we are subject to the ebbs and tides of the marketplace."

Union Pacific Railroad, he said, has climbed from near the bottom of the industry in 1984 (in terms of operating income and margins) to near the top, and mining operations remain profitable on earnings of some $60 million annually.

Lewis said UPC has formed a new subsidiary, Union Pacific Technologies, and the company's computerized, fiber optic and microwave transportation information and control system is among the best in the industry currently helping train Japanese, Chinese and Mexican groups on updating their railroad communication and control systems.

Lewis conceded he is disappointed with the performance of Overnite Transportation Co., a trucking firm UPC purchased in October, 1986, earnings for which were down slightly to $43 million last year.

"(But) we continue to feel quite comfortable with this acquisition," said Lewis. "We feel there has been a bottoming out of the intense price competition in (the trucking) industry and that 1988 will be a much improved year."

The best opportunity of 1987, said Lewis, was UPC's acquisition of United States Pollution Control Inc., a hazardous waste management company.

" . . . Union Pacific is likely the largest hauler of hazardous waste in the country," said Lewis. "We feel this is a field with tremendous growth potential, a business with very little downside in terms of recession, and it is a business in which both the public and the government will continue to invest a great deal of money for the foreseeable future."