Would the following grammar be ambiguous?
Indeed, both of those derivations produce the same parse tree.

A grammar is ambiguous iff it has two different leftmost derivations for a sentence. (Equivalently, if it has two different rightmost derivations.) Only one of the provided derivations is leftmost, so these two derivations do not constitute a demonstration of ambiguity.

The grammar is ambiguous, though:

$$\begin{align}&amp;S\to aSbS \to abS \to abaSbS\to ababS \to abab\\
&amp;S\to aSbS \to abSaSbS \to abaSbS \to ababS \to abab\\
\end{align}$$