This example assumes the plan view of the curve-path for the roller coaster is constructed in XY, and raised to its various heights in Z. The incoming curve has its 'Twist' set to 'Minimum'.
This approach constructs another curve from the supplied path, adapted to be a base for your pillars.
- The parts of the curve on which the track is either very steep, or inverted, are removed, so will not spawn pylons:
.. discriminating by asking how aligned the curve's Normal x Tangent
is aligned to object Z. If you delete/separate points from a curve, in GN, it just dissolves them. We want to delete them. That's why the curve is converted to a mesh, and back again. The mesh is deleted according to the curve's captured normal.
- We want to sample lengths from the curve's projection in XY..
.. we store the curve's Z for future use, and then scale it to 0 in Z. We sample lengths from the flat version. We can then instance the pylons on those samples, and use the stored Z, one way or another, to raise them to the correct height.
In this case, I've put simple extruded-by-0 grids on the sample points, and then ray-cast up from them, 'shrink-wrapping' the tops of the extrusions to the underside of the track, so I haven't used the stored Z...
You might use the stored Z. Perhaps to locate the tops of your columns, as instances, or by raising a selection-by-Z of your column-template to an offset of the stored value.