There is already a perfect, accepted answer, but I thought I add this to point out that there is a geometric reason for the dimension to possibly drop versus the transcendence degree.
For simplicity assume that the fraction field of $A$ is a finitely generated field extension of $k$ and that $A$ is integrally closed. If we are doing geometry these assumptions seem reasonable (and there is already a complete answer in the general case). I think with a little more work one can follow a similar argument without these assumptions, but this post's goal is mainly to explain the geometry behind this phenomenon, so I am not striving for completeness especially that (as I already mentioned twice) since there is already a complete solution there is no need to do that.
So, first, $A$ contains a transcendence base for its fraction field over $k$, in other words we have
$$
k\subseteq k[x_1,\dots,x_n]\subseteq A \subseteq \mathrm{Frac} (A)
$$
where $\mathrm{Frac} (A)$ is a finite algebraic extension of $k(x_1,\dots,x_n)$. Now let $B$ be the integral closure of $k[x_1,\dots,x_n]$ in $\mathrm{Frac} (A)$. Since $A$ is assumed to be integrally closed, $B\subseteq A$ and since $\mathrm{Frac} (A)$ is a finite algebraic extension of $k(x_1,\dots,x_n)$, $B$ is a finitely generated $k[x_1,\dots,x_n]$-module and a finitely genrated $k$-algebra and $\mathrm{Frac} (B)=\mathrm{Frac} (A)$.
The integral $k$-algebra extension $k[x_1,\dots,x_n]\subseteq B$ corresponds to a finite surjective morphism $X\to \mathbb A^n_k$ of $k$-varieties, so for $X$ we have the quoted result: $\dim X$ equals the transcendence degree of the fraction field of $A$.
Now we have that $B\subseteq A \subseteq \mathrm{Frac} (B)=\mathrm{Frac} (A)$. In geometric situations this typically happens if $A$ is a localization of $B$. In that case we get that the Krull dimension of $A$ is at most the Krull dimension of $B$ because the dimension of $A$ is just the maximum height of the points of $\mathrm{Spec}B$ contained in $\mathrm{Spec} A$.
This is really why I wrote this whole answer: the way the Krull dimension drops versus the transcendence degree is if we localize at non-closed points: In your original example $k(x)$ corresponds to the generic point of the line $\mathbb A^1$, so its geometric dimension = transcendence degree is $1$, but its algebraic dimension is $0$ because it is a field (or more generally the local ring of a non-closed point).