Proving that a context-free grammar is unambiguous
Consider the word $abab$. It has two derivation trees (rendered using syntree):





Hence your grammar is ambiguous. In order to make an unambiguous grammar, we have to force the parse to be unique. We identify the word with a path in which $a$ corresponds to $\nearrow$ and $b$ to $\searrow$. We're looking for a non-empty path that ends at level ground.

If the path starts with $\nearrow$, then we can look at the first time at which it returns to level ground, and decompose the path accordingly: $\nearrow x \searrow y$, where $x$ is a path that never goes below level ground, and $y$ is an arbitrary path that ends at level ground. Hence we need a way to capture paths that end at level ground and never go below level ground. Such a path can also be decomposed uniquely as $\nearrow x \searrow y$, where this time both $x$ and $y$ never go below level ground.

The considerations above lead to the following unambiguous grammar:
$$
\begin{align*}
&amp;S \to aAbS' \mid bBaS' \\
&amp;S' \to aAbS' \mid bBaS' \mid \lambda \\
&amp;A \to aAbA \mid \lambda \\
&amp;B \to bBaB \mid \lambda
\end{align*}
$$

As a somewhat degenerate example, the derivation tree for $abab$ is:


The proof that this grammar is unambiguous goes along the description above, though the formal proof by induction is somewhat challenging.