The U.S. coal industry has warned the Reagan administration that the construction of the multibillion-dollar Soviet natural gas pipeline could threaten the growth of American coal exports to Western Europe and hurt this country's mining industry, railroads and ports.

The warning was given this week at a meeting between representatives of the coal industry and the 10 agencies that make up a government task force on coal policy.

At the same time, it was learned, the State and Commerce departments have told the Interstate Commerce Commission that they oppose deregulation of rail rates for coal because the United States is trying to persuade its European allies that U.S. coal is preferable to gas from the Soviet Union and the deregulation would make its price less competitive.

The administration is in final stages of resolving a major internal dispute over U.S. policy on the planned Soviet pipeline, the largest East-West project in history.

The pipeline issue has opened up sharp divisions between the U.S. government, which opposes the project, and the European allies, which look to the project to stimulate the equipment export business and create jobs in the short run, and provide new sources of energy by the middle of the decade.

On Dec. 30, President Reagan announced the United States was prohibiting export of American-built turbine rotors and pipelaying equipment needed for the project.

In the next few days he is expected to decide whether to try to extend these sanctions to European companies manufacturing equipment for the Soviet pipeline under U.S. licenses, a step that would delay the project but would also produce a clash with the allies.

At the heart of the administration's argument is that the Europeans would be better off politically and economically using non-Soviet sources of energy.

In a brief filed Dec. 21 in connection with the ICC deregulation case, the State and Commerce Departments said:

"The United States has attempted to convince its friends and allies that U.S. coal represents an energy source that is preferable to oil from unstable Middle Eastern states, gas from the U.S.S.R. or coal from South Africa or Poland . . . . The question of future energy sources is crucial to the economic strength of the West."

The American coal alternative to Soviet natural gas is also backed by Rep. Mario Biaggi (D-N.Y.), chairman of the House merchant marine subcommittee, who has introduced a bill that would pay for deepening six ports so they can handle a significant increase in coal exports.

The United States has always sold substantial amounts of coal in Europe, primarily metallurgical coal used in the steel industry.

However, coal exports to Western Europe rose dramatically after 1978 as a result of rising oil prices and erratic coal production in Poland, the main American competitor.

Utility companies and other European industries, such as cement producers, converted steam boilers from oil to coal. Last year U.S. exports of coal for this purpose totaled 26 million tons, up from negligible quantities a few years earlier.

U.S. and European banks to whom Poland owes money are counting on revived Polish coal exports to raise the foreign currency needed to pay off these debts, even as the United States is attempting to increase its share of the West European coal market, which reached 60 percent in 1981.

Connie Holmes, vice president of the Washington-based National Coal Association, said the industry has calculated that the new Soviet gas, when delivered to Western Europe, would be equivalent to an additional 90 million tons of coal.

She said the United States, with one-fourth of world coal reserves, could easily supply that amount, once ports and harbors here are improved to handle the increased volumes.

Association President Carl Bagge said yesterday, "We can deliver."

But he said the pipeline would provide stiff competition and also would stall development of gas produced from coal or synfuels, which West German industrialists had been enthusiastic about until the pipeline project emerged as a possible alternative.

Bagge said he had "raised holy hell" with Europeans attending the International Coal Congress in London recently because they have resisted signing long-term purchase agreements for U.S. coal deliveries.