Will freezing water still expand width-wise in a pipe (possibly breaking it) if it's free to expand lengthwise?
It might do.

Imagine you have a U-shaped pipe. The two ends are above ground. The pipe runs into the ground for a short length in the middle, then back out again. It's free at both ends but filled with water.

You have a problem there because in cold temperatures, the two above-ground parts are going to freeze first. Then, if it's really cold, the underground part will freeze also. When that happens, the already-frozen above-ground ice won't move and your underground pipe may well go pop. What was initially "free at both ends" became blocked.