Short answer
It depends on how much rust there is and how much surface you are willing to lose. Steel wool is quick, cheap and needs no setup. Electrolysis takes more time and equipment, but it can reach rust that a pad can’t and does not scrub the surface the same way.
What steel wool does well
Steel wool works well on light to moderate rust you can reach. A few minutes of scrubbing, followed by a rinse and a dry, may be enough for a pan with a little surface rust. It costs little and needs no tank, power or electrolyte.
The drawback is that it is abrasive. Steel wool removes rust by wearing away material, and it can take off seasoning and polish or scratch the cooking surface. On a pan you want to keep smooth, that matters.
What electrolysis does well
Electrolysis works through the bath rather than through scrubbing. It can loosen rust in crevices, on the underside of a skillet and inside a Dutch oven, where a pad can’t easily go. For heavy rust, it often gets further with less effort, since you are not working the surface by hand.
It needs a tank, electrolyte, an anode, a charger and time, plus attention to safety. It also leaves a dark residue that still has to be cleaned off.
Surface results
Steel wool can leave a rough or bare surface, depending on how hard you work it. Electrolysis leaves a dark, powdery residue and sometimes a slightly roughened surface if the bath runs too long. Neither method gives back a smooth, seasoned pan by itself. Both are followed by drying, oiling and seasoning.
Cost and effort
Steel wool is the easy choice for one small pan. Electrolysis is worth the setup for heavy rust, several pieces, or a bigger item such as a griddle, where scrubbing by hand would take a long time.
Using both
Some people use a light pass of steel wool after a bath to clear the residue. Go gently, and stop once the surface is clean. Heavy scrubbing after electrolysis undoes some of the benefit of the bath.
When neither is the answer
Neither method fixes cracks, warping, broken parts or deep pits. If the piece is structurally damaged, the rust is not the main problem.
Where to read more
For heavy rust specifically, the piece on how to remove heavy rust from cast iron covers the options. For light rust with steel wool, see the article on how to remove rust with steel wool. For the bath itself, read the guide to electrolysis for cast iron restoration.