At 5:30 on a winter morning, the frozen plains of this part of Wyoming are barren and forbidding. The land stretches flat. There are no trees. Scattered clumps of scrub brush look black against the snow.

"It's enough to make you wonder how the first settlers ever made it," says Harlan Wiley, a supervisor for Neosho Construction Co., peering out of his pickup truck in the dim light.

Down a dirt road covered with snow come two more pickups. They stop and 20 men in parkas jump out, stamp their feet and rub their hands to fight the cold. The men smile and wave at Wiley but talk only among themselves, for few speak English. They are Mexicans and American Indians, and they have come here to work on the railroad.

Railroad building has always been largely an immigrant business. As many as 15,000 Chinese were working on the rail when the transcontinental railroad first linked the East and West coasts in 1869. They were joined and then succeeded by arrivals from Italy and Ireland. But by about 1915 railroad construction had all but ceased, and the children of the immigrants moved to less-strenuous trades.

Now, despite the physical and financial decrepitude of so many railroads, a few are building track again on a small scale. The Atchison, Topeka & Santa Fe in New Mexico, the Norfolk & Western in West Virginia, and the Burlington Northern here in Wyoming are all laying track, and all for the same reason: the hope of carrying more coal.

The line Burlington Northern is building here is the longest stretch of new track built in the United States since 1931. The 116-mile track cuts through a rich region of low-sulfur coal and links the railroad's two main Wyoming lines. It is almost complete, and trains have begun running over it. w

Burlington Northern hauled 80 million tons of coal last year, and with the help of new track it hopes to carry at least 115 million in 1983. The road is betting heavily on the new track: building it costs $1 million a mile.

As in the 19th Century, immigrants are doing much of the labor. They come from Mexico, and many are illegal aliens. They are joined by a few Indians from reservations, to which their ancestors were sent a centuryago, to clear the way for railroads.

Like their predecessors, these modern railroads workers are drawn by wages they find hard to get elsewhere: $5.50 per hour, with time and a half for overtime. Local residents have shied away from the project, largely because they are better able to land higher-paying jobs in the coal mines.

The $350 or more a week the railroad builders earn is a long way from the $35 the Chinese got. But for the men working on the Burlington Northern line, a lot of other things haven't changed since the heyday of railroad construction. Despite all the advances in machinery and technology, notes Harry Wilkison, the road's engineer supervising the project, "It's still some of the hardest physical work you can do."

It lasts 10 hours a day, six days a week. The temperature here often touches 20 below zero this time of year, and 100 above in the summer. Last summer, the Univeristy of Wyoming sent several members of its football squad here to work on the railroad. They lasted two hours.

In the 1860s, a newspaper reporter vividly recorded the sounds of railroad building. "It's a grand anvil chorus that those sturdy sledges are playing across the plains," he wrote. "Triple time, three strokes to a spike, 10 spikes to a rail, 400 rails to a mile. . . ."

Nowadays, builders have automatic spiking machines. Yet the machines can't drive all the spikes, because roadbeds aren't perfectly even; and over the roar can still be heard the rhythmic clang of hammers hitting metal. The workers gather in pairs, taking turns striking a spike with their eight-pound sledges.

One thing that has changed is the lenth of the rails. Each is a quarter of a mile long and is put in place by a machine.

A few months ago, the work here was even more strenuous. More than 350,000 wooden ties, each weighing 200 pounds, had to be arranged precisely 20-1/2 inches apart along the length of the lines.

"After work, some of the guys like to go to town, have a few beers," says Bennie Lewis, a 23-year-old Navajo who has been working here since September. "Me, I'm too tired. I just go home and rest."

The Navajos became railroad workers much the same way the Chinese did a century before them: through a visit by a labor contractor unable to hire enough help locally. The Chinese, despite skepticism that they could do the heavy labor, soon proved themselves by working hard, complaining little and avoiding liquor and talk of unions. The Navajos were recruited by Burlington Northern's contractor, Neosho Construction Co., and -- like the Chinese -- have proved able workers.

As for the hiring of the Mexicans, Neosho's head man at the project, James Ward, says they "just appeared at the door" of his office one day.

Immigration authorities say the Mexicans probably heard there was work in Wyoming and paid a smuggler to bring them across the border. Twice last summer, employes of the Immigration and Naturalization Service raided the Burlington Northern project, arresting as many illegal aliens as they could fit into a van.

The deportation has proved only a temporary remedy, however. "I have been back to Mexico three times since I and my brother first came here in 1975," says one Mexican, who doesn't want to be named. "But there is no work there, so I like to keep coming back."

Lewis, the Navajo, says he went home a few weeks ago, but his wife told him to come back. "There was no work for me on the reservation," he says.

Perhaps because of these dim prospects, the Mexicans and Indians often prove model workers. Donald Williamson, a 35-year-old foreman with Neosho Construction, is in charge of a 20-man crew. "If I had my choice, I'd take an all-Mexican or an all- Indian crew over an all-white crew," says Williamson, who is white. "My best workers have been Mexicans and Indians."

"Any time you have trouble," he continues, "it's because you have a ringleader. Say you have 20 Mexicans; there's always one guy who's the spokesman, the one guy you go through to give instructions because most of them can't speak English. Sometimes this guy gets to thinking he'll decide what the workers will do and when they'll do it, not the foreman." h

Williamson says that has happened twice in five months. "Both times I gave the ringleader two warnings," he recounts. "Then I fired him."

But the disruptions are slight by comparison with those in the heyday of railroad building. Wherever the huge rail crews of the 19th century went, hucksters and prostitutes followed. One traveler who passed through a railroad camp in Montana wrote, "Law is unknown here. The inhabitants spend their time gambling, drinking and shooting each other."

When 5 p.m. comes at Logan's Sidingt, the workers board the pickups and return to their quarters. Instead of the tent cities and bunk-lined box cars that housed their predecessors, Burlington Northern's railroad workers live in trailers, six men in each. There is no rush to taverns.

In a converted railroad station that serves as the contractor's headquarters, two veteran supervisors sip coffee. Between them. George Butler and Harlan Wiley have worked on the railroad more than 80 years. Their job now is to drive up and down the line, solving problems and making sure the work is done right.

"I could never work in a factory or something like that," Bultler says. "The same thing day after day -- that would drive me crazy. I've been on this project for 3-1/2 years. That's the longest I've been in any one place since I started in this business."

Wiley, too, is drawn by something about life on the rail. "I'm 69 years old," he reflects. "I don't need the money. I could be home with my wife in retirement. But I couldn't stand it. Be home 30 days and I start going crazy."

Neither of the old-timers can quite understand why there is such high turnover on this project, why younger workers seem to regard railroad building as just another construction job. "There are some great opportunities out here," says Wiley, sounding like a man who has survived harder times. "But these kids just pass them by."