Yes -- if the coordinates (real number triples) $c_f$ can be assigend to the elements of set $M$ as required in the statement of the question, given the distances (ratios) $d$ and function $f$ as described above then the metric space $(M, d \,)$ is flat.
Because: for any fifteen (real) numbers, $\{ x_\alpha, y_\alpha, z_\alpha \}$, $\{ x_\beta, y_\beta, z_\beta \}$, $\{ x_\gamma, y_\gamma, z_\gamma \}$, $\{ x_\phi, y_\phi, z_\phi \}$ and $\{ x_\lambda, y_\lambda, z_\lambda \}$ the following determinant vanishes
0 = $ \begin{array}{|cccccc|}
0 & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\alpha - k_\beta)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\alpha - k_\gamma)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\alpha - k_\phi)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\alpha - k_\lambda)^2}} & 1 & \\
{\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\beta - k_\alpha)^2}} & 0 & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\beta - k_\gamma)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\beta - k_\phi)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\beta - k_\lambda)^2}} & 1 & \\
{\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\gamma - k_\alpha)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\gamma - k_\beta)^2}} & 0 & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\gamma - k_\phi)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\gamma - k_\lambda)^2}} & 1 & \\
{\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\phi - k_\alpha)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\phi - k_\beta)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\phi - k_\gamma)^2}} & 0 & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\phi - k_\lambda)^2}} & 1 & \\
{\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\lambda - k_\alpha)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\lambda - k_\beta)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\lambda - k_\gamma)^2}} & {\small{\sum\limits_{ k \in \{ x \, y \, z \} } (k_\lambda - k_\phi)^2}} & 0 & 1 & \\
1 & 1 & 1 & 1 & 1 & 0 & \end{array}$.
Consequently, for any five distinct elements $A$, $B$, $J$, $K$ and $Q$ $\in M$ holds
0 = $ \begin{array}{|cccccc|}
0 & \left(\frac{f[ c_f[ A ], c_f[ B ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ A ], c_f[ J ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ A ], c_f[ K ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ A ], c_f[ Q ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 1 & \\
\left(\frac{f[ c_f[ B ], c_f[ A ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 0 & \left(\frac{f[ c_f[ B ], c_f[ J ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ B ], c_f[ K ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ B ], c_f[ Q ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 1 & \\
\left(\frac{f[ c_f[ J ], c_f[ A ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ J ], c_f[ B ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 0 & \left(\frac{f[ c_f[ J ], c_f[ K ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ J ], c_f[ Q ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 1 & \\
\left(\frac{f[ c_f[ K ], c_f[ A ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ K ], c_f[ B ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ K ], c_f[ J ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 0 & \left(\frac{f[ c_f[ K ], c_f[ Q ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 1 & \\
\left(\frac{f[ c_f[ Q ], c_f[ A ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ Q ], c_f[ B ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ Q ], c_f[ J ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & \left(\frac{f[ c_f[ Q ], c_f[ K ] ]}{f[ c_f[ A ], c_f[ B ] ]}\right)^2 & 0 & 1 & \\
1 & 1 & 1 & 1 & 1 & 0 & \end{array}$;
and therefore also
0 = $ \begin{array}{|cccccc|}
0 & \left(\frac{d[ A, B ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ A, J ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ A, K ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ A, Q ]}{d[ A, B ]}\right)^2 & 1 & \\
\left(\frac{d[ B, A ]}{d[ A, B ]}\right)^2 & 0 & \left(\frac{d[ B, J ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ B, K ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ B, Q ]}{d[ A, B ]}\right)^2 & 1 & \\
\left(\frac{d[ J, A ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ J, B ]}{d[ A, B ]}\right)^2 & 0 & \left(\frac{d[ J, K ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ J, Q ]}{d[ A, B ]}\right)^2 & 1 & \\
\left(\frac{d[ K, A ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ K, B ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ K, J ]}{d[ A, B ]}\right)^2 & 0 & \left(\frac{d[ K, Q ]}{d[ A, B ]}\right)^2 & 1 & \\
\left(\frac{d[ Q, A ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ Q, B ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ Q, J ]}{d[ A, B ]}\right)^2 & \left(\frac{d[ Q, K ]}{d[ A, B ]}\right)^2 & 0 & 1 & \\
1 & 1 & 1 & 1 & 1 & 0 & \end{array}$.
Thus, the (normalized) Cayley-Menger determinants of distance ratios between any five elements of set $M$ vanishes; the metric space $(M, d \,)$ is flat. (However, the metric space $(M, d \,)$ is then still not necessarily plane, or even straight.)
The suitable assignment of real number triples $c_f$ to elements of any flat metric space, together with the described function $f$ therefore provides a good (scaled-isometric) representation of the given flat metric space.