Does a whole "compose" its parts?

No. Comprises is right.

Compose indicates joining things together. "The cars compose the train; the train is composed of cars."

Comprise indicates splitting a composite (see what I did there?). "The train comprises its cars."


Why use a relative clause? No verb is needed here; the cars aren't doing anything, after all.

Try either

In order to find the length of the train, you need to measure the individual cars in it.

or

In order to find the length of the train, you need to measure its individual cars.

(The contracted will is also unnecessary in context, so I deleted it too.)

Simpler is clearer.