EDIT Here's a concrete solution for finding the longest section within each spline of a curve object:
First, lets compute the actual section lengths (point to point). This is more complicated than one might think, because if we just go to the next point it will jump to the next spline at the end and give us negative section lengths. I made a little utility node group to compute this.
Now we could use the attribute transfer technique to compute the longest section, grouped by spline index, but there are a few more hurdles to overcome.
First we need to compute the index of the spline for each point. Best way i found is to use the Index input node and capture it on the spline domain. When we then use this attribute for points it will get transferred automatically, so each point uses the spline index we captured. Call it a "domain transfer".
Next, we have to modify the min/max node group a bit. The version i made above searches for the minimum value, so we have to change it to using the maximum value.
Since we using curves we also have to fix the problem that "Transfer Attribute" only works on meshes. The node will show a little error icon:
To fix this we can set the curve resolution to 1 and then convert to points. We only need this during the search, it won't affect the output geometry.
And that, at long last, gives use the desired max length section index. Phew!