I also recommend making a brush. It can be useful to make a pattern brush from lines, because the result can be expanded to strokes.
I put three colors instead of two to show how it behaves:
Draw a horizontal (=hold shift) line, make 2 copies and give the needed colors and widths. You can select the colors as well in step 2.
Align the lines. Most accurate result is got by aligning them at first to the same place and moving two of them up and down with Object > Transform > Move. My lines were 4pt wide, so I moved vertically +4pt and -4pt. Color selections can well be made after aligning the lines.
Select all and drag them to the brushes collection. Define them to be a pattern brush which is stretched to the needed length.
A test curve is drawn with the pen
The new brush is applied, NOTE:The curve is still a fully editable single path.
Maybe useful to know that this is possible: The shape is expanded (Object > Expand Appearance). Then it's ungrouped three times. That splits the shape to separate bended lines. Two of them has been dragged aside and one is selected.
NOTE: If the original lines are longer than the curve, expanding appearance generates full length curve per color.
- Also maybe useful: Impossibly tight curves cause unexpected results: