A simple counterexample is the space $\mathbb R^n$, with a metric $g_{ab}$ independent on the point. As examples, the Euclidean space $\mathbb R^n$, but also the Minkowski spacetime (which is semi-Riemannian, but has the same geodesics as $\mathbb R^4$). The geodesics are the lines in $\mathbb R^n$, no matter how we choose the constant metric $g_{ab}$. Hence, different metrics can give the same set of geodesics.

Consider now a Riemannian manifold $(M,g)$, and the geodesics determined by $g$. We can choose a point $p\in M$, and a metric $g'_p$ defined on $T_pM$. Then, we can use the Levi-Civita connection of $g$ to translate the metric $g'_p$ at the other points. It may happen that the metric obtained at any point $q$ by translating $g'_p$ is independent on the path, and that the geodesics of the obtained metric are the same. One case is when $(M,g)$ is flat, as in the counterexample, and in this case $g'_p$ can be any metric at the starting point $p$. Another case is when $g'=a g$ for some constant $a\gt 0$, like in the question. In the first case, we can choose $g'_p$ at $p$ as we wish, and the number of parameters will be $\frac{n(n-1)}{2}$. In general, the choice will be constrained by the condition that the parallel translation gives the same metric $g'_q$ at $q$ independent on the path. The most constrained case is when $g'=a g$, with one constant parameter $a$.