Make child object go along the same curve as parent
A possibility is to parent the cylinder to vertices of the curved object:

Before adding the curve modifier:

in edit mode select 3 vertices of the object
come back to object mode,
select the cylinder
Shift select the object
then CtrlP and choose &quot;Vertex triangle&quot;