It was more of a back-and-forth.
You can build a narrative of one side out-pacing the other if you cherry-pick firsts, but their capabilities were very close. The timeline of first achievements is interleaved. Firsts grab headlines and demonstrate national priorities, but they don't show capability well.
The other side would often accomplish something similar only months later showing only very narrow capability gaps. For example, R-7 was the first successful ICBM and basis for the Soviet space program, the US had success with Atlas A less than a year later. Vostok-1, first human space flight and (just barely) first orbit, was followed a month later by Freedom 7 (first pilot controlled flight) and a year later by Friendship 7. Luna 9, first soft landing on the Moon, was followed a few months later by Surveyor 1.
They also both had very high failure rates. The Luna program had five failures (not made public at the time) before its first unmitigated success (Luna-2), meanwhile the US was losing Pioneer probes. The Luna program had a 35% success rate compared to 60% for equivalent US programs (the exact numbers depend on exactly how you count success).
Several of these firsts had close-calls which could have turned them into another failure. Vostok-1 had a partial separation failure on reentry. Gus Grisson almost drowned. Voskhod 2, the first spacewalk, had a suit malfunction.
However some areas did show a clear edge, for example imaging was dominated by the US because they wanted spy satellites. And one thing is clear, the US consistently made more orbital and deep space launches with a greater diversity of launch vehicles.
The civilian space race started when both the US and Soviets in 1955 announced they would launch satellites to celebrate the International Geophysical Year in 1958.
Prior to the start of the civilian space race in 1955, both nations were working on ICBMs. The Soviets built their successful R-7. They would focus their efforts on the R-7 eventually creating Molniya, and the wildly successful Vostok and Soyuz rocket families. This allowed the Soviets to focus their efforts, but also put most of their eggs into one basket.
In the US, rocket development became a turf war between the Army and the new Air Force (formerly the Army Air Force) with the Army focusing on tactical rockets, the Air Force on strategic rockets, and both sniping at each other to get funding.
The US was concerned with the optics of using a military rocket to launch civilian satellites, and that adding a civilian program to a top-priority military rocket might slow down its development. Military involvement would heighten then unresolved legal issues about overlying another country with a satellite.
The result was several families of launch vehicles being developed simultaneously by several different organizations. Slower to get started, but more robust. The Army's Redstone and variants Jupiter and Juno. The Air Force's Atlas. The Navy Research Laboratory's Viking sounding rocket was turned into the orbital launch vehicle Vanguard. Plus Thor which became Delta.
While the Soviets captured early firsts, the US was not particularly behind. Sputnik 1 was launched in October 1957, an 84 kg sphere that beeped, the simplest satellite. Sputnik 2 launched in November 1957 and was significantly more capable featuring telemetry, a Geiger counter, spectrophotometers, a dog life support (which unfortunately failed), and a TV camera. Meanwhile in the US Vanguard 1A failed in December 1957.
1958 would see the US rapidly catching up. 1958 saw 5 orbital launch attempts by the Soviets all with the R-7, and only one success: Sputnik 3 carrying numerous instruments.
The US had 23 launches across 6 rocket types with 5 successes and 2 partial failures.
- Explorer 1 put the first US satellite in orbit to catch up with the Soviets.
- Vanguard 1 was the first
to use solar power.
- Explorer 3, same as Explorer 1.
- Explorer 4 studied the radiation belts.
- Pioneer 1 was an attempt to orbit the Moon, but failed to achieve lunar orbit. It had multiple instruments and was used to test communication relays.
- Pioneer 3 was intended to reach the Moon and then go into solar orbit, but it failed to reach the Moon instead being used to study the radiation belts.
- SCORE tested satellite communication relay broadcasting a recorded Christmas message go beyond Sputnik's beeps.
1959 would see just two Soviet orbital and deep space successes and one partial with Luna 1, 2, and 3 all with an R-7 derivative. The US had successful/partial Vanguard, Discoverer/Corona, Explorer, and Pioneer launches.
1960 would see just three Soviet orbital successes, all Vostok test flights. The US had 16 successful orbital and deep space flights.
The space race would go on like this with the US outpacing the Soviets in number of orbital launch attempts and successes, and with a larger diversity of launch vehicles.
To be clear, I'm not saying the US was "ahead". I'm rejecting the view of 1955-1970 as a linear race to put a person on the Moon measured only by cherry-picked firsts and offering a broader view. If there's a US tilt to this answer its because I'm more familiar with the US space program.