We have$$\begin{align}& \, (b-a) + (d-c) - |(a,b) \cup (c,d)| \\ =& \, |(a, b)| + |(c, d)| - |(a,b) \cup (c,d)| \\ =& \, |(a,b) \cap (c,d)|\end{align}$$where the last identity is an application of $|A \cup B| + |A \cap B| = |A| + |B|$.
It follows that$$\begin{align}&|(a,b) \cup (c,d)| = (b-a) + (d-c) \\\iff & |(a,b) \cap (c,d)| = 0 \\\iff & (a,b) \cap (c,d) = \emptyset.\end{align}$$The last equivalence holds because an open set has Lebesgue measure zero if and only if it is the empty set.