Defense Secretary Frank C. Carlucci, in a surprising reversal of Pentagon policy, told the Senate Foreign Relations Committee yesterday that the controversial MX nuclear missile should be pulled out of missile silos and instead deployed on railroad cars to protect it from a Soviet attack.

"I've got some problems with the way it's presently based," Carlucci said in response to a question about the silo-deployed MX during the committee's hearing on the new U.S.-Soviet treaty eliminating medium- and shorter-range nuclear missiles.

Carlucci said he thought the MX missiles, designed to strike targets in the Soviet Union with pinpoint accuracy, "ought to be taken out of the fixed silos and put on a mobile system, and I hope the Congress would support us somehow."

Carlucci's comment, later reaffirmed by aides, appeared to jeopardize an ongoing multibillion-dollar Air Force program to put 50 MX missiles in silos, a program at the heart of the Reagan administration's strategic nuclear modernization program.

His comment also appeared to undercut the administration's longstanding claim that the deployment of the missiles in silos posed little increased risk of war with the Soviet Union.

Aides said that Carlucci, unlike his predecessor, Caspar W. Weinberger, opposed silo basing because it left the 10-warhead MX missiles vulnerable to Soviet attack, creating dangerous incentives for the Soviets to strike first in an effort to destroy the missiles at the outset of an international crisis.

This viewpoint has long been argued by critics of the MX missile, but has been stoutly rejected by the Air Force, which manages the MX program.

Carlucci, in response to a question from Sen. Joseph R. Biden Jr. (D-Del.), said he was expressing his "personal views" on the MX, but an aide said later that "he means what he says and it does represent a departure from past policy."

Air Force officials expressed surprise at Carlucci's remarks in interviews yesterday afternoon. "My understanding is that we are proceeding with the deployment in silos," said Maj. Barry Glickman, an Air Force spokesman.

Thirty-two MX missiles are already in silos, although technical troubles involving the missiles' guidance system have kept roughly one-third of them from being placed on alert. Another silo-based MX missile is to be formally turned over to the Air Force Strategic Air Command today, and existing plans called for the remaining 17 missiles to be deployed in silos at Warren Air Force Base in Wyoming by the end of the year.

The alternative approach favored by Carlucci -- to put the MX missile on railroad cars -- has recently been under intense investigation at the Defense Department as a means to deploy an additional 50 missiles not yet authorized by Congress.

Congress agreed to spend $20 billion on the first 50 MX missiles only after a long and bitter fight over basing schemes, and has resisted buying any new MX missiles until the Pentagon settled on a new approach ensuring the missiles could not readily be attacked.

Reagan in 1981 rejected a plan conceived by his predecessor, President Jimmy Carter, to deploy the MX missiles on trucks capable of sprinting through the southwestern desert to evade a Soviet attack.

Earlier schemes studied and rejected by the Pentagon called for the missile to be deployed on ships in inland coastal waterways, shallow trenches, jumbo jets or dirigibles. A panel of experts appointed by the White House urged in 1982 that the missile be deployed either in extremely deep holes or on lightweight, slow-moving prop-jets.

Under the approach Carlucci favors, the missiles would be deployed on specially designed railroad cars, similar to strategic missile-launching rail cars deployed by the Soviet Union.

In peacetime, the rail cars would sit idly in a "garrison" at a military base. Upon warning of a potential enemy attack, locomotives would tow them away from the base as rapidly as possible to be dispersed -- and effectively hidden -- on the nation's rail network.

Once the trains were out of harm's way, the missiles would be fired at the Soviets in a devastating nuclear retaliation, according to the Pentagon's plan.