Note. This answer is work-in-progress. It will change a lot in the next few minutes. You can also find interesting details at Wikipedia, I am using similar notation as in that article.
In order to detail the relationship between the two models of the Heisenberg group that you have specified, I will first lay out the general Definition of Heisenberg groups on symplectic vector spaces. I will then show how your two models are a special case of this Definition.
Symplectic vector spaces and Darboux basis (TODO: Add references)
Let $V$ be a finite-dimensional vector space over a field $F$ and let $\omega:V\times V\to F$ be a bilinear map such that $\omega(v,v)=0$ for all $v\in V$ and such that for all $u\in V$, we have $\omega(u, v)=0$ for all $v\in V$ if and only if $u=0$ (the latter property is also called "non-degenerateness").
By a standard result from linear algebra, $V$ must have an even dimension.
The standard symplectic vector space is $V=\mathbb R^{2n}$ for some $n\in\mathbb N$ together with the bilinear form $\omega$ given by $\omega(v,w)=\langle v, Aw\rangle$, where $A\in\mathbb R^{2n\times 2n}$ is the matrix $$A=\begin{pmatrix} 0 & \operatorname{Id}_n \\ -\operatorname{Id}_n & 0\end{pmatrix}.$$
For $n=1$, this reduces to $V=\mathbb R^2$ and $\omega((x,y), (\tilde x, \tilde y)) = x \tilde y - \tilde x y$.
The Heisenberg group on symplectic manifolds
Let $(V, \omega)$ be a finite-dimensional real symplectic vector space. The Heisenberg group $H(V)=H(V,\omega)$ on $V$ is defined as the set $V\times\mathbb R$ together with the group operation $\cdot$, mapping $(v,t)$ and $(v', t')$ to
$$(v, t)\cdot (v', t') = \left(v+v', t+t' +\frac 12\omega(v,v')\right).$$
Symplectic representation of the Heisenberg group (TODO: insert references)
By a classical result from linear algebra, every symplectic vector space $(V,\omega)$ of dimension $2n, n\in\mathbb N$, admits a Darboux basis, consisting of vectors $\mathbf e_1,\dots, \mathbf e_n, \mathbf f^1, \dots, \mathbf f^n\in V$, such that $\{\mathbf e_1,\dots,\mathbf e_n, \mathbf f^1,\dots,\mathbf f^n\}$ form a basis of $V$, and such that $\omega(\mathbf e_j, \mathbf f^k)=1$ if $j=k$ and $0$ otherwise.
In the special case $n=1$ with $\omega$ as defined above, such a Darboux basis is given by $\mathbf e_1 = (1,0)$ and $\mathbf f^1 = (0,1)$.
Consider the subspace $\{0\}\times\mathbb R\subset V\times\mathbb R$, and let $E$ denote a basis of this subspace (for example $E=(0,0,\dots, 0, 1)$). (Note that this is wrongly defined in the Wikipedia article.)
A vector $v\in V\times\mathbb R$ can now be written uniquely as (using the Einstein summation convention) $$v=q^a\mathbf e_a + p_a \mathbf f^a + t E$$ for some $q^1,\dots,q^n,p_1,\dots,p_n, t\in\mathbb R$.
Let $p=(p_1,\dots, p_n)$, $q=(q^1,\dots, q^n)$ and denote by $[p, q, t]$ the vector $v$ obtained above. Then the group law can be written as
$$[p,q,t]\cdot[p',q',t']=[p+p',q+q',t+t'+\frac 12(\langle p, q'\rangle -\langle p', q\rangle)].$$
This corresponds to the second Definition that you give of the Heisenberg group.
Matrix representation of the Heisenberg group
Consider now all matrices of the form
\begin{equation*}\{p,q,u\}=\begin{pmatrix}
1 & p & u \\
0 & \operatorname{Id}_n & q \\
0 & 0 & 1
\end{pmatrix}
\end{equation*}
where $p,q$ are vectors in $\mathbb R^n$ and $u\in\mathbb R$. Denote the set of all such matrices by $M_H(n)$, and define the group $\tilde H$ as $M_H(n)$ equipped with the group operation
$$\{p,q,u\}\ \tilde\cdot\ \{p',q',u'\}=\{p+p',q+q',u+u'+\langle p,q'\rangle\}.$$
Equivalence as groups
We now consider the map $T:H(V)\to\tilde H$ given by $T([p,q,t])=\{p,q,t+\frac 12\langle p, q\rangle\}$.
Claim. $T$ is a group isomorphism.
Proof. Proving the fact that $T$ is bijective is left as an exercise to the reader. Now, let $[p,q,t],[p',q',t']\in H(V)$. We have
$$T([p,q,t]\cdot[p',q',t'])=T([p+p',q+q',t+t'+\frac 12\langle p, q'\rangle-\frac 12\langle p', q\rangle])=\{p+p',q+q',t+t'+\frac 12 \langle p, q'\rangle - \frac 12\langle p', q\rangle+\frac 12\langle p+p', q+q'\rangle\}=\{p+p',q+q',t+t'+\frac 12\langle p, q\rangle+\frac 12\langle p', q'\rangle+\langle p,q'\rangle\}.$$
On the other hand,
$$T([p,q,t])\ \tilde\cdot\ T([p',q',t']) =\{p,q,t+\frac 12\langle p,q\rangle\}\tilde\cdot\{p',q',t'+\frac 12\langle p',q'\rangle\}=\{p+p',q+q',t+\frac 12\langle p,q\rangle+t'+\frac 12\langle p',q'\rangle\}.$$
Since both terms are equal, $T$ is thus indeed a group isomorphism. $\square$
Riemannian metric equivalence (TODO: finish writing paragraph)
We now define Riemannian metrics on $H(V)$ and $\tilde H$, considered as submanifolds of $\mathbb R^{2n+1}$, as
$g($