Same surface, different mass
Both are bare iron-based metal. Both are protected by seasoning - polymerized oil - which the owner renews forever. Neither has a coating to wear out, and neither has an end of life short of being dropped or rusted away through outright neglect.
So this is not a durability comparison. Both win that. It is a physics comparison, and the variable is mass.
Mass means heat retention
A heavy cast iron skillet stores a lot of heat energy. When you put a cold steak into it, the surface temperature drops and then recovers quickly because the pan has reserves. That recovery is what produces a crust.
A thin carbon steel pan has fewer reserves. With a thick cold steak it drops and stays down, and the meat grays rather than browns. With a thin cutlet or a piece of fish, it is perfectly capable.
Low mass means responsiveness
The same property in reverse. Turn the burner down under cast iron and nothing happens for thirty seconds; turn it down under carbon steel and the pan follows almost immediately.
For eggs, for garlic that is about to burn, for a pan sauce that needs to stop reducing - responsiveness is what you want, and cast iron simply cannot give it to you.
Weight, which decides more purchases than physics does
A 12-inch cast iron skillet is heavy enough that some people genuinely cannot lift it one-handed when full. A comparable carbon steel pan weighs about a third less and can be tossed.
A pan you avoid using is worth nothing, however good its heat retention. If weight is the reason your cast iron lives in the cupboard, carbon steel is the answer and so is Lodge’s thinner Blacklock line.
Practical differences nobody mentions
Handles. Cast iron handles are cast as one piece and get hot but are easy to grip with a cloth. Carbon steel handles are riveted or welded steel, get hotter, and are usually long enough to be awkward in a domestic oven.
Sidewalls. Carbon steel pans have sloped sides for tossing; cast iron skillets have straighter, shallower walls that suit roasting and cornbread.
Warping. Cast iron does not warp. Thin carbon steel can, from thermal shock - typically cold water into a hot pan.
The honest answer
Own both. A 12-inch cast iron skillet for searing, roasting and bread; an 11-inch carbon steel pan for eggs, fish and anything you need to move. Together they are under 150 dollars, they both carry seasoning you renew yourself, and neither of them will ever need replacing.
If you can only own one: cast iron, because it is cheaper, it does not warp, and the jobs it is bad at can be done in a cheap stainless pan.