[guided]We compute the inversion set rather than using an abstract parity argument, because the transposition has only two moved points and its inversions can be listed explicitly. Define
\begin{align*}
I(\tau):=\{(a,b)\in\{1,\dots,n\}^2:a<b\text{ and }\tau(a)>\tau(b)\}.
\end{align*}
Since $\tau$ swaps $i$ and $j$ with $i<j$, we have $\tau(i)=j$, $\tau(j)=i$, and $\tau(r)=r$ for all $r\notin\{i,j\}$.
First, we identify the inversions that definitely occur. The pair $(i,j)$ is an inversion because
\begin{align*}
\tau(i)=j>i=\tau(j).
\end{align*}
Next take an intermediate index $k\in\{1,\dots,n\}$ satisfying $i<k<j$. Since $k$ is fixed by $\tau$, the pair $(i,k)$ is an inversion:
\begin{align*}
\tau(i)=j>k=\tau(k).
\end{align*}
The pair $(k,j)$ is also an inversion:
\begin{align*}
\tau(k)=k>i=\tau(j).
\end{align*}
Thus every pair in
\begin{align*}
\{(i,j)\}\cup\{(i,k):i<k<j\}\cup\{(k,j):i<k<j\}
\end{align*}
belongs to $I(\tau)$.
Now we rule out all other pairs. Let $(a,b)$ be a pair with $a<b$. If neither $a$ nor $b$ is one of the swapped indices, then both are fixed, so
\begin{align*}
\tau(a)=a<b=\tau(b),
\end{align*}
and no inversion occurs. If $b=i$, then $a<i$, and
\begin{align*}
\tau(a)=a<j=\tau(i),
\end{align*}
so $(a,i)$ is not an inversion. If $a=j$, then $b>j$, and
\begin{align*}
\tau(j)=i<b=\tau(b),
\end{align*}
so $(j,b)$ is not an inversion. If $a=i$ and $b>j$, then
\begin{align*}
\tau(i)=j<b=\tau(b),
\end{align*}
so $(i,b)$ is not an inversion. If $a<i$ and $b=j$, then
\begin{align*}
\tau(a)=a<i=\tau(j),
\end{align*}
so $(a,j)$ is not an inversion.
The only remaining possible inversions are therefore $(i,j)$, the pairs $(i,k)$ with $i<k<j$, and the pairs $(k,j)$ with $i<k<j$. There are $j-i-1$ intermediate indices $k$ satisfying $i<k<j$, so
\begin{align*}
|I(\tau)|=1+(j-i-1)+(j-i-1)=2(j-i)-1.
\end{align*}[/guided]