Let $(I_1,...,I_n)$ denote an ordered collection of subintervals on $[a,b]$ such that $\sup I_k \le \inf I_{k+1}$.
Let ${\cal P'}$ be the set of all such collections.
Let ${\cal P}$ be the set of partitions of $[a,b]$, it should be clear that ${\cal P} \subset {\cal P'}$.
Let $TV, TV_2$ be your definition and second formulation, respectively. I will drop the $[a,b]$ part of your notation as this is fixed here.
We have $TV(g) = \sup_{\pi \in {\cal P} } \sum_{I \in \pi} |g(\sup I) -g(\inf I)|$, and
$TV_2(g) = \sup_{\pi' \in {\cal P'} } \sum_{I \in \pi'} |g(\sup I) -g(\inf I)|$
Since ${\cal P} \subset {\cal P'}$, we have $TV(g) \le TV_2(g)$.
Now suppose $\pi' \in {\cal P'} \setminus {\cal P}$. It should be clear that we can add subintervals to $\pi'$ to get a partition $\pi \in {\cal P}$ such that every interval in $\pi'$ is also in $\pi$.
Furthermore,
$\sum_{I \in \pi'} |g(\sup I) -g(\inf I)| \le \sum_{I \in \pi} |g(\sup I) -g(\inf I)| \le TV(g)$.
Consequently, we have $TV_2(g) \le TV(g)$ and so they are equal.
Note: It is not hard to see that if the subintervals are strictly non overlapping (that is, empty intersection), then this is not true. Take
$g = 1_{\{{1\over 2}\}}$ on the interval $[0,1]$. Then
$TV(g) = 2$, but $TV_2(g) = 1$.