How can elements have the same number of electrons, but different electron configurations?
The reason is very complicated, but in short:
The energy gap between $\ce{3d}$ and $\ce{4s}$ is wider in $\ce{Cr^2+}$ than in $\ce{Ti}$ because $\ce{Cr^2+}$ has more protons.

When you promote an electron from $\ce{3d}$ to $\ce{4s}$, the electron gained the energy thanks to orbitals, but you also lost the energy thanks to repulsion (of electrons in the same orbital). Remember that electrons like to be in states of less energy, not more.

The energy gap between $\ce{3d}$ and $\ce{4s}$ is less in $\ce{Ti}$, so the electron, by promoting, lost more energy thanks to repulsion than it gained thanks to the orbital, so its configuration is $\ce{[Ar] 4s^2 3d^2}$.

In $\ce{Cr^2+}$, the enrgy gap widened, so the electron would gain more energy than its lost by promoting, making its configuration $\ce{[Ar] 3d^4}$.

See also chemguide.co.uk.