Surely, one of the oddest experiences you can have riding a railroad is to find yourself on a 14-car train entirely jacked up off the tracks while you watch the wheels come flying out along the rails beneath you. It happened to us in Kuznice Bielostocka, a Polish town on the Soviet Union border.

It was just one of the unexpected and fascinating sights of nearly a month's trip last spring to get acquainted with part of communist eastern Europe -- East Germany, Poland and Hungary -- and reacquainted with the Soviet Union. We traveled by train from East Berlin to Leningrad with stops in Warsaw and Vilnius, then flew on to Moscow and to Budapest before returning to Washington.

Over the past 30 years one of us had been in the Soviet Union three times, the other twice, with all trips at decennial intervals: 1955, 1965 and 1975. Last year we added Hungary, where life is more pleasant, as a contrasting bonus. Flying is quicker, but train travel is the way to see the country and the people close up. We managed to cram it all into 25 days, Washington to Washington.

We found a sense of people trapped in -- but by and large resigned to -- life under the shadow and, ultimately, the iron rule of the Soviet Union. And going by train from East Berlin to Warsaw to Vilnius to Leningrad, we could visualize the armies of Napoleon and Hitler sweeping across the northern European plain and understand why the Russians are so determined to assure defense in depth between themselves and western Europe.

The encounter with the train wheels provided a vivid reminder of how deep-seated is that Russian paranoia over the security of its borders.

In Kuznice Bielostocka, the through trains -- ours came from East Berlin bound for Leningrad -- are hoisted up so that their four-wheel trucks can be pulled out and new trucks substituted to fit the Russian five-foot-wide track instead of the 4-foot-8 1/2-inch gauge standard in eastern and western Europe.

Why the differing gauges? The rest of Europe, like the United States, was standardized long ago, but the Russian czars (so the story goes) stuck to their wide gauge as a way to keep invaders from rolling into their country by rail. The communists retained the gauge, but it didn't stop Hitler's mechanized vehicles or planes.

We found our train positioned between a series of 56 permanently emplaced jacks spaced so that each pair matched one of each car's two four-wheel trucks. When all were in place, a man at a central control panel electrically activated all 56 jacks and the series of Archimedes screws lifted us up. Workmen had previously disconnected wheel trucks from the base of each car, so that as soon as they were free of the cars the trucks could be pulled out from beneath us by a cable. At the same time the wide-gauge wheel trucks were being brought in from the other end of the train by the same cable, rolling down on the extra rails that formed the wider gauge. The lifting and connecting process then was reversed.

We did the East Berlin to Leningrad trip -- in all, about 1,100 miles, somewhat farther than Boston to Atlanta -- in three bites, with stopovers first in Warsaw and then in Vilnius in Soviet Lithuania. All the trains shared some characteristics, some of them unpleasant: There were no dining cars, reading lights were inadequate, and the toilets generally were filthy.

East Berlin to Warsaw is a nine-hour run of about 350 miles, costing $23 for a seat in a six-person first-class East German sitting compartment. Second-class compartments, we heard, were the same size but with shoddy, harder upholstery, and third class reputedly still has the hard wooden benches of the pre-war era.

We settled comfortably into our compartment, along with a middle-aged Polish gentleman. Just after the train pulled out, four teen-age East German girls squeezed into the three seats opposite. They held second-class tickets but neither the East German nor (once we crossed the border) Polish conductor made a serious effort to evict them.

We broke the ice with our fellow passengers by offering them our two copies of the International Herald Tribune (available in East Berlin but not in Warsaw or in Soviet cities). The girls passed them around, with intermittent giggles as they tried to figure out the English. Two of them seemed more interested in the Peanuts comic strip than in news of the Soviet-American row of the moment. But the Pole read them avidly and passed them back with thanks but no comments, although from then on we did get some illuminating information from him: Brown coal is mined in this region, salt near that town, the city of Poznan' (where many people got off and on) is famous for its machinery and chemical production. Finally, he alerted us to get off at the right station in Warsaw.

The girls, it turned out, were among the lucky East Germans who get to travel outside their country. Through their fractured English and our fractured German we learned they were headed for a week in Warsaw, part of a large group scattered through the train whose leaders appeared now and them to check on them. Some 300,000 Poles and an equal number of East Germans, youths and labor groups are being exchanged under a new agreement between the governments.

Our train was jammed with passengers, some going only to the German border city ofFrankfurt/Oder, others to various Polish towns. Many had to stand all day in the cars' corridors.

Coming into Warsaw is akin to entering any big industrial capital city -- endless railroad yards, factories, junk heaps, with newer apartments (both walk-up and high-rises) and offices off on the horizon. Warsaw itself has been almost totally rebuilt after the carnage of World War II. The most charming part of the city is the old town, with its square alive with throngs of picture-taking Poles, food and ice-cream stands under colorful umbrellas, and lottery ticket vendors. The lovingly reconstructed 18th-century, four-to-six-story pastel-colored buildings that surround the square give an aura of Old World charm. Not far away is the rebuilt one-time royal castle and on the edge of the city is the famous 17th-century Wilanow Palace.

But, of course, the reality of Poland is far closer to poverty than to plenty. The masses of Polish American tourists who throng the major hotels all seem to look like millionaires from another world, compared with the native Poles -- even though brightly colored skirts, blouses and sweaters now are seen all over Warsaw.

We had begun this journey in East Berlin, a city with half the population of West Berlin. East Berlin is usually visited by westerners who "go over" for a few hours by way of the famous "Checkpoint Charlie." We found it well worth a longer stop. New buildings, some pleasant restaurants and better-dressed pedestrians all contributed to the sense of a far livelier city than when we last were there 10 years ago. This time we stayed three days.

The Ostbahnof (east station) in East Berlin was 10 minutes by cab from our hotel. A dollar bill was sufficient to get the cabbie to act as porter as well. But in Warsaw's central station the platform was dark and we had to tote our bags up a nonescalating escalator before a friendly Pole helped us to a cab stand. There again, the American dollar worked magic in getting us to our hotel.

After the three days in Warsaw, we bought first-class tickets, also $23 each, for the Warsaw-Vilnius run of 11 3/4 hours. We found ourselves in a Polish car with berths instead of seats. We called the porter to ask that he convert the beds into seats and learned they didn't convert. So all day we perched on the edge of the lower berth, ducking to avoid bumping the upper, or we stood in the corridor and watched Poland go by.

We knew the Russians had had little luck in getting the Poles to collectivize their family farms, and this was strikingly evident as we crossed the East German-Polish border, the Oder River. Instead of the huge tracts of land we had seen in East Germany, the view from the train in Poland was of an endless series of small farms. In almost every case there was a little wood house, a barn, outhouse and other small structures at one end of a plot, with some chickens scratching about. There was the farmer plowing his field with his horse, his wife holding the reins and one or more children following behind to drop seed by seed. Yet from these tiny, inefficient but fiercely defended private plots comes an estimated 80 percent of Poland's food.

The towns we passed through, or where the trains stopped briefly, all seemed neat and clean enough but their drabness was apparent. Horsecarts with old auto tires on their wheels, paved streets in the town centers but dirt roads radiating out into the countryside typified the way of life. Not only were postwar reconstructed Roman Catholic churches visible but also numerous new ones.

Just after crossing that Polish-Soviet frontier, before we reached Grodno in Byelorussia (White Russia), we found ourselves in an evergreen forested area. Suddenly, we saw cleared strips in seemingly random zigzag patterns, perhaps 100 feet wide and carefully harrowed so that every footprint would show. Alongside the strips ran a metal fence of six feet or so, quite obviously wired to transformers that electrified it. Such is the nature of this border between "fraternal socialist states."

At this border we were subject to the most thorough baggage search ever in all our visits to the Soviet Union. A very large female customs inspector appeared, checked our declarations, felt under the mattress and proceeded to pounce on each of our four bags, rooting with both hands. Apparently looking for printed matter, she left everything a mess.

Although she asked in English "any newspapers?" she didn't wait for a reply. She pulled out several paperback mysteries, guidebooks and the front section of The Washington Post, handing each to a more courteous fellow female customs agent, who flipped through them and passed them back to us. The only thing that really interested them was a fly-sheet in German we had picked up in West Berlin, a protest of some sort that we had carelessly stuck into an overcoat pocket. But even that finally passed inspection.

Vilnius offers a striking contrast between the masses of new high-rise apartments that crown the hills surrounding the city and the old city itself. Downtown are both handsome modern buildings and old residential blocks of housing built in squares surrounding courtyards where children play under the day's laundry hanging out to dry. Lithuanians are proud of their culture, their language and, often, of their Roman Catholic religion despite the four decades since the country's incorporation into the Soviet Union.

The final leg of our trip, Vilnius to Leningrad, was in a first-class Soviet sleeping car equipped with three berths -- though the top one must have been built for a midget. These were typical massive Soviet-built railway cars with polished wood and neatly pressed antimacassars on the headrests of each seat. The car's porter brought us clean sheets and pillowcases and helped make up the berths.

We had been told in Washington, by cable from Moscow, that only second-class sleepers holding four to a compartment were available, but a helpful Intourist agent in Vilnius' Hotel Lietuva got us into first class for a few dollars extra (total charge was $31 each). In fact, only a couple of first-class compartments were occupied.

We were sleeping soundly when around 4 a.m. we discovered the sliding window had worked open as we were rolling into the cold Russian north. We couldn't make the latch catch, so the only way to keep from freezing was to put on all our clothes and overcoats and pile on the bedding. The one saving grace was a choice from our porter (whom we couldn't awaken at 4 a.m.) of good coffee or tea for breakfast before we pulled into Leningrad's Warsaw station after a run of almost exactly 12 hours. The old station was jammed with people and it was cheering to have the waiting Intourist guide spot us as soon as we left the train.

The most hilarious -- at least in retrospect -- incident of our journey occurred when we found ourselves, with our four bags, on a Warsaw platform between two tracks. On each was a train about to depart, and each displayed a sign saying Leningrad. But no sign said Vilnius. Which one went there?

We ran up to a man boarding one train: "Vilnius?" we asked. He nodded, pointing to his train. Not convinced, we ran to the other train: "Vilnius?" we yelled to a boarding passenger. He said yes and pointed to his train. It must be this one, we concluded -- he speaks English. Then we spotted a conductor and showed him our tickets. "Right here," he said, "car number 12."

We scurried into old number 12 just as the two trains began to pull out. They proceeded to a junction at the edge of the city -- and then were joined together!