Every day, about 20 freight trains grind slowly out of the gigantic Potomac Yard in Alexandria, hauling everything from toxic chemicals to United Parcel Service packages to rail depots up and down the eastern seaboard.

Those trains heading north operate, for the most part, without cabooses. Those heading south through Virginia, on the other hand, must adhere to a 74-year-old state law requiring cabooses.

Yesterday, a House of Delegates committee in Richmond voted to repeal Virginia's caboose law, setting the stage for a significant victory for the railroad industry, a defeat for railroad unions, and the end of a railroading era that the public associates with steam locomotives and shrill whistle blasts splitting the night quiet.

"All of these icons had a place in the past and the caboose did too," said William Dempsey, president of the Association of American Railroads. "But at the present time we just don't need it anymore."

Montana is the only other state that still requires cabooses, although a federal court ruled in November that the law could no longer be enforced. The case in on appeal. In Virginia, the House is expected to vote in favor of repealing the law and proponents expect the Senate will follow suit.

Railroads have already begun to phase out the caboose, replacing it with a $4,500, shoebox-sized electronic device that indicates whether the train's cars are attached and their brakes are working properly, functions once performed by men in red kerchiefs and overalls. Those men also used flags and lanterns to warn following trains of the traffic ahead, a task now performed by automatic signals.

Most retired cabooses are sold for their scrap value. Still others become additions to restaurants or parks; a few have even been sold for hunting lodges, according to John F. McGinley, superintendent of the Potomac Yard.

Hoping to protect jobs, railroad unions have negotiated contracts calling for cabooses on some trains and have lobbied heavily against the repeal of the Virginia's caboose law.

"Even if these machines were perfect, they don't have a sense of smell or sight," said Houston Kitts, legislative director for the United Transportation Union in Richmond, which represents about 180,000 railroad employees nationwide. "I've never seen one yet that could see down the side of a train."

History does not record when the first caboose appeared on an American railroad. John White, senior historian with the National Museum of American History, said the term first appeared in railroad literature dating from the 1850s. The name itself has maritime roots, according to White. Caboose was theterm that described an outdoor kitchen on the deck of a ship, "a place of shelter and warmth," he said.

The first cabooses were crude affairs, often converted boxcars or simple huts built on railroad flatcars. Eventually, cabooses (for a time, "cabeese" was the accepted plural) acquired windowed cupolas, where trainmen could sit and watch the cars ahead to check for dragging gear or smoke from a "hot box," an overheated set of wheel bearings.

The caboose assumed a vital role with the invention of air brakes around the turn of the century, according to White.

Crewmen were required at the rear of the train to monitor air pressure in the lines, among other things.

The "end-of-train" device, an electronic box that can alert the engineer in a locomotive to changes in the air pressure in the brake lines, removed that job from human hands. Train crews, meanwhile, have shrunk from five members -- engineer, brakeman, fireman, flagman and conductor -- to three or four. The railroads would like to reduce crews to two members.

Federal regulators have concluded that the disappearance of the caboose does not compromise safety and believe the matter should be resolved through labor negotiations. "We've never considered it a safety issue," said William Loftus, a spokesman for the Federal Railroad Administration.

Unions concede that cabooses are not necessary on every train, but they are not willing to give them up entirely. Kitts would like Virginia to require cabooses on trains more than a mile long or those carrying hazardous materials. "We feel like we're doing the lobbying that should be done by the environmentalists," Kitts said.

Industry representatives contend a hazardous materials rule would place an impossible burden on the railroads. "On all general commodity trains, you'll find a car with hazardous materials," Dempsey said. The accident rate for trains without cabooses is no different from trains with them, he said.

The Association of American Railroads estimates that cabooses cost the industry about $400 million nationwide each year, or more than a fourth of the $1.3 billion in profits earned by the railroads in 1986. Most of the costs stem from extra fuel and maintenance needs. A new caboose, if anyone wants to buy one, costs $80,000.

Virginia's location at the heart of the eastern seaboard means that the caboose law has an impact beyond the state's borders. The law applies to any freight train that passes through the state, not just those that originate there.

The Potomac Yard, a staging area for freights destined to locations throughout the East, is well stocked with cabooses, although blue has replaced red as the predominant color and coal and wood-burning stoves have been replaced with oil-fired versions.

Three Virginia railroad companies, Norfolk Southern, CSX Corp. and the Richmond, Fredericksburg & Potomac Railroad, which operates the Potomac Yard, have dispatched lobbyists to Richmond to urge repeal of the caboose law.

"Five years from now, I would not expect to see a caboose, except in some unique or peculiar situations," said McGinley, the Potomac Yard superintendent.