The distinction between

and

doesn't matter here.
WLOG let the segments be

with

.
Triangle inequality:
In fact this is equivalent to

, for the given constraints. (

so we can substitute using

.)
(Edited out a false start.)
So we have two variables x, y with uniform probability distribution in [0,1]. I made a sketch:
The shaded area is the probability we want, which is

.