Get Inkscape (=freeware). Its Dynamic offset can work in your case. The effect is exportable. If one saves the result as plain SVG, it can be opened in Illustrator with no problems.

A too thick curve. It isn't a stroke, it's a filled shape just like your shapes are.
The fill is removed, a thin green stroke is inserted to show the problem
Path > Dynamic Offset is applied, the adjusting handle is dragged to minimum area position.
NOTE: To see the result better the adjustment is best to do for a filled shape which has no stroke. The green stroke is inserted here only for demonstration.
The method can be developed to get a single stroke, if that's needed. In Inkscape the Dynamic Offset is an readjustable effect. It can be fixed with Path > Object to Path. That makes the result a normal path. But it's still a closed shape if it's made of a shape which was like image 1.
That closed shape can be broken at the ends by splitting the path with the node tool. There's typically good nodes for it at tight curves, but one can also insert new nodes for it. Here the splitting is done and that half which got the original big rounded ends is moved apart:

In Inkscape splitting a path doesn't release the halves, the result is a compound path. The parts must be released with Path > Break Apart. Illustrator's scissors release the halves as soon as they are clipped apart.
If the shape is like a closed path, a single stroke version needs different approach. In the next image the blue shape is actually a combined path (see the nodes):

A red copy is made and Dynamic offset is applied to the copy:

The Dynamic Offset is fixed by applying Path > Object to Path and the combined shape is broken to 2 separate paths with Path > Break Apart. 2 separate closed shapes was generated. Both of them are quite nearly the midlines of the original curve. Another of the shapes is moved aside, both have got a thin stroke:

Dynamic offset isn't faultless. At sharp corners it can decide wrongly (=create a shortcut) and some edits are needed.