Recently I reviewed my question posted almost one year ago and I think I'v got an answer. Let's re-look the basis of Ramanujan's identity first.
Given polynomial $x^3+ax^2+bx+c^3=0$,$\quad3$ roots are $x_1, x_2,$ and $x_3$.
$$x_1+x_2+x_3=-a,\quad x_1x_2+x_2x_3+x_3x_2=b,\quad x_1x_2x_3=-c^3$$
Then
$$\sqrt[3]{x_1}+\sqrt[3]{x_2}+\sqrt[3]{x_3}=\sqrt[3]{-a-6c+3t} \tag1$$
Here
$$t=\sqrt[3]{x_1^2x_2}+\sqrt[3]{x_1x_2^2}+\sqrt[3]{x_1^2x_3}+\sqrt[3]{x_1x_3^2}++\sqrt[3]{x_2^2x_3}+\sqrt[3]{x_2x_3^2}$$
This can be derived by calculating $(\sqrt[3]{x_1}+\sqrt[3]{x_2}+\sqrt[3]{x_3})^3$ directly.
Calulating $t^3$ we have
$$t^3=3(ac+b+3c^2)t-(ab+6(ac^2+bc)+9c^3) \tag2$$
For polynomial $x^3+ax^2-(3m^2+am)x+m^3=0$, $\;3$ roots are $x_1, x_2,$ and $x_3$. Using $(1)$ and $(2)$ we have
$$\sqrt[3]{x_1}+\sqrt[3]{x_2}+\sqrt[3]{x_3}=\sqrt[3]{3\sqrt[3]{mp}-(6m+a)}\,,\quad p=9m^2+3am+a^2\tag3$$
For polynomial $x^3-ax^2-(3m^2+am)x-m^3=0$, $\;3$ roots are $x_1, x_2,$ and $x_3$. Using $(1)$ and $(2)$ we have
$$\sqrt[3]{x_1}+\sqrt[3]{x_2}+\sqrt[3]{x_3}=\sqrt[3]{(6m+a)-3\sqrt[3]{mp}}\,,\quad p=9m^2+3am+a^2\tag4$$
Let $p$ be a prime number congruent to $1$ modulo $6$, $p=9m^2+3am+a^2,\, m\in \mathbb Z, a\in \mathbb N$.
$S_p(g), S'_p(g), \text{and }S''_p(g)$ are defined as in the question above.
As described in the paper "Generalized Ramanujan's identity" mentioned in the question,
since $p \equiv 1 \mod 6$, by a theorem of Gauss there are integers $A$ and $B$ such that
$$4p=A^2+27B^2$$
For $a \equiv 1 \mod 3$, let $A \equiv 1 \mod 3$ and $B>0$, then $A$ and $B$ are uniquely determined as
$$A=-3m-2a \,\text{ and }\, B=\left | m \right |$$
The sums $S_p(g), S'_p(g), \text{and }S''_p(g)$ are the roots of the polynomial
$$h(x)=x^3+x^2-\frac{p-1}{3}x-\frac{Ap+3p-1}{27} \;\in \mathbb Z(x) \tag5$$
See reference [Has] in the paper.
Now we need to make the polynomial form $x^3+ax^2-(3m^2+am)x+m^3$ in order to get the desired result by $(3)$. Suppose a cubic polynomial $h_p(x)$ has the 3 roots
$$x_1=S_p(g)+n,\quad x_2=S'_p(g)+n,\quad x_3=S''_p(g)+n$$
To make the coefficient of $x^2$ term equal to $a$
$$x_1+x_2+x_3=S_p(g)+S'_p(g)+S''_p(g)+3n=-a$$
By $(5)$ we have $S_p(g)+S'_p(g)+S''_p(g)=-1$, then
$$3n-1=-a,\quad n=-\frac{a-1}{3}$$
Now calculating the coefficients of $x$ term and constant term of $h_p(x)$. By $(5)$ we have
$$S_p(g)S'_p(g)+S'_p(g)S''_p(g)+S_p(g)S''_p(g)=-\frac{p-1}{3},\quad S_p(g)S'_p(g)S''_p(g)=\frac{Ap+3p-1}{27}$$
Then
\begin{align}
&x_1x_2+x_2x_3+x_1x_3\\
=&(S_p(g)+n)(S'_p(g)+n)+(S'_p(g)+n)(S''_p(g)+n)+(S_p(g)+n)(S''_p(g)+n)\\
=&S_p(g)S'_p(g)+S'_p(g)S''_p(g)+S_p(g)S''_p(g)+2n(S_p(g)+S'_p(g)+S''_p(g))+3n^2 \\
=&-\frac{p-1}{3}+2\frac{(a-1)}{3}+3\left(\frac{a-1}{3}\right)^2 \\
=&-\frac{p-a^2}{3} \\ \\
&x_1x_2x_3 \\
=&(S_p(g)+n)(S'_p(g)+n)(S''_p(g)+n) \\
=&S_p(g)S'_p(g)S''_p(g)+n(S_p(g)S'_p(g)+S'_p(g)S''_p(g)+S_p(g)S''_p(g))+n^2(S_p(g)+S'_p(g)+S''_p(g))+n^3 \\
=&\frac{Ap+3p-1}{27}+\frac{(a-1)}{3}\frac{(p-1)}{3}-\left(\frac{a-1}{3}\right)^2-\left(\frac{a-1}{3}\right)^3 \\
=&\frac{Ap+3ap-a^3}{27}
\end{align}
So
$$h_p(x)=x^3+ax^2-\frac{p-a^2}{3}x-\frac{Ap+3ap-a^3}{27} \tag6$$
Since $p=9m^2+3am+a^2$ and $A=-3m-2a$, we have
$$h_p(x)=x^3+ax^2-(3m^2+am)x+m^3$$
The 3 roots of $h_p(x)$ conform to $(3)$, and we have the desired result
$$\sqrt[3]{S_p(g)+n}+\sqrt[3]{S'_p(g)+n}+\sqrt[3]{S''_p(g)+n}=\sqrt[3]{3\sqrt[3]{mp}-(6m+a)}\,,\quad n=-\frac{a-1}{3}$$
Again there are integers $A$ and $B$ such that
$$4p=A^2+27B^2$$
For $a \equiv 2 \mod 3$, let $A \equiv 1 \mod 3$ and $B>0$, then $A$ and $B$ are uniquely determined as
$$A=3m+2a \,\text{ and }\, B=\left | m \right |$$
In the same way, we need to make the polynomial form $x^3-ax^2-(3m^2+am)x-m^3$ in order to get the desired result by $(4)$. Suppose a cubic polynomial $h_p(x)$ has the 3 roots
$$x_1=S_p(g)+n,\quad x_2=S'_p(g)+n,\quad x_3=S''_p(g)+n$$
To make the coefficient of $x^2$ term equal to $-a$
$$x_1+x_2+x_3=S_p(g)+S'_p(g)+S''_p(g)+3n=a \\
3n-1=a,\quad n=\frac{a+1}{3}$$
Calculating the coefficients of $x$ term and constant term of $h_p(x)$. By $(5)$ similarly we can derive
$$h_p(x)=x^3-ax^2-\frac{p-a^2}{3}x-\frac{Ap-3ap+a^3}{27} \tag7$$
Since $p=9m^2+3am+a^2$ and $A=3m+2a$, we have
$$h_p(x)=x^3-ax^2-(3m^2+am)x-m^3$$
The 3 roots of $h_p(x)$ conform to $(4)$, and we have the desired result
$$\sqrt[3]{S_p(g)+n}+\sqrt[3]{S'_p(g)+n}+\sqrt[3]{S''_p(g)+n}=\sqrt[3]{(6m+a)-3\sqrt[3]{mp}}\,,\quad n=\frac{a+1}{3}$$
For $p=9p'$ where $p'$ is $1$ or a prime, and $p'\equiv 1 \mod 6$, $p'=9m'^2+3a'm'+a'^2$.
The Euler's totient function of $p$ is
\begin{align}
&\varphi(p)=\varphi(9)=6 \;\;\;\text{when }p'=1\\
&\varphi(p)=6(p'-1) \;\;\;\text{when }p'\text{ is a prime}
\end{align}
The integers up to $p$ that are relatively prime to $p$ can also be divided into $3$ subgroups $H_1, H_2, H_3$. For $p'=1$ or $p=9$, a generator $g=2$ can be used. When $p'$ is a prime or $p=9p'$, the count of integers in each subgroup is $2(p'-1)$. We may need $\left \{ g_1, g_2 \right \}$, a generating set of $(\mathbb{Z}/p\mathbb{Z})^\times \cong \mathrm{C}_{p'-1} \times \mathrm{C}_6$.
For $p=9$, $S_p, S'_p,$ and $S''_p$ are defined as in the question above.
For $p'$ is a prime or $p=9p'$, consider the sums of cosines for each group as below.
$$
S_p \stackrel{\text{def}}{=} \sum_{k=0}^{\frac{p'-4}3} \sum_{j=0}^{5}\cos \left(\frac{2\pi}{p}g^{3k}_1g^j_2\right) ,\quad
S'_p \stackrel{\text{def}}{=}\sum_{k=0}^{\frac{p'-4}3} \sum_{j=0}^{5}\cos \left(\frac{2\pi}{p}g^{3k+1}_1g^j_2\right), \\
S''_p \stackrel{\text{def}}{=} \sum_{k=0}^{\frac{p'-4}3} \sum_{j=0}^{5}\cos \left(\frac{2\pi}{p}g^{3k+2}_1g^j_2\right)
$$
\begin{align}
p=&9p'=81m'^2+27m'a'+9a'^2\\
=&9(-3m'-a')^2+3(-3m'-a')(3a')+(3a')^2\\ \\
m=&-3m'-a'\quad \text{and}\quad a=3a'\\ \\
p=&9p'=81m'^2+27m'a'+9a'^2\\
=&9(a')^2+3(a')(9m')+(9m')^2\\
=&9(-a')^2+3(-a')(-9m')+(-9m')^2\\ \\
m=&a'\quad \text{and}\quad a=9m'\quad \text{for}\quad m'>0\\
m=&-a'\quad \text{and}\quad a=-9m'\quad \text{for}\quad m'<0\\ \\
\end{align}
So there are integers $m$ and $a$ such that
$$p=9m^2+3am+a^2,\quad a \equiv 0 \mod 3,\quad m\in \mathbb Z,\quad a\in \mathbb N$$
Suppose there are integers $A$ and $B$ such that
$$4p=A^2+27B^2$$
Let $A \equiv 0 \mod 3$ and $B>0$, then $A$ and $B$ can be determined as
$$A=-3m-2a,\quad B=\left | m \right |$$
The sums $S_p, S'_p,$ and $S''_p$ are roots of the polynomial
$$h(x)=x^3-\frac{p}{3}x-\frac{Ap}{27} \;\in \mathbb Z(x) \tag8$$
I don't know how to prove $(8)$, but it should be similar to the proof for $(5)$.
Now we need to make the polynomial form $x^3+ax^2-(3m^2+am)x+m^3$ in order to get the desired result by $(3)$. Suppose a cubic polynomial $h_p(x)$ has the 3 roots
$$x_1=S_p+n,\quad x_2=S'_p+n,\quad x_3=S''_p+n$$
To make the coefficient of $x^2$ term equal to $a$
$$x_1+x_2+x_3=S_p+S'_p+S''_p+3n=-a$$
By $(8)$ we have $S_p+S'_p+S''_p=0$, then
$$3n=-a,\quad n=-\frac{a}{3}$$
Now calculating the coefficients of $x$ term and constant term of $h_p(x)$. By $(8)$, as similar calculation process as above, we have
$$h_p(x)=x^3+ax^2-\frac{p-a^2}{3}x-\frac{Ap+3ap-a^3}{27}$$
Since $p=9m^2+3am+a^2$ and $A=-3m-2a$, we have
$$h_p(x)=x^3+ax^2-(3m^2+am)x+m^3$$
The 3 roots of $h_p(x)$ conform to $(3)$, and we have the result
$$\sqrt[3]{S_p+n}+\sqrt[3]{S'_p+n}+\sqrt[3]{S''_p+n}=\sqrt[3]{3\sqrt[3]{mp}-(6m+a)}\,,\quad n=-\frac{a}{3}$$
If we let
$$A=3m+2a,\quad B=\left | m \right |$$
and make the polynomial form $x^3-ax^2-(3m^2+am)x-m^3$ in order to get the desired result by $(4)$, we have the other result
$$x_1+x_2+x_3=S_p+S'_p+S''_p+3n=a \\
3n=a,\quad n=\frac{a}{3} \\
h_p(x)=x^3-ax^2-\frac{p-a^2}{3}x-\frac{Ap-3ap+a^3}{27} \\
h_p(x)=x^3-ax^2-(3m^2+am)x-m^3$$
The 3 roots of $h_p(x)$ conform to $(4)$, and we have
$$\sqrt[3]{S_p+n}+\sqrt[3]{S'_p+n}+\sqrt[3]{S''_p+n}=\sqrt[3]{(6m+a)-3\sqrt[3]{mp}}\,,\quad n=\frac{a}{3}$$
There are $2$ possible values for $n$, and $n$ is taken with the sign making the constant term of $h_p(x)$ a perfect cube number. We need to select the sign for $n$ then veirfy if $(S_p+n)(S'_p+n)(S''_p+n)$ is equal to $m^3$ or $-m^3$.
I have verified the results with examples $p=9, 63, 117, 171, 279, 333, 387, ...$
\begin{array}{c|c|c|c|c|c|c|c}
\style{font-family:inherit}{p} & \style{font-family:inherit}{m}
& \style{font-family:inherit}{a} & \style{font-family:inherit}{A} & \style{font-family:inherit}{B} & \style{font-family:inherit}{n} & \style{font-family:inherit}{h_p(x)} & \style{font-family:inherit}{\text{generator}}\\\hline
9 & 1 & 0 & -3 & 1 & 0 & x^3-3x+1 & \left \{ 2 \right \} \\\hline
9 & -1 & 3 & -3 & 1 & -1 & x^3+3x^2-1 & \left \{ 2 \right \} \\\hline
63 & 1 & 6 & -15 & 1 & -2 & x^3+6x^2-9x+1 & \left \{ 2,5 \right \} \\\hline
63 & -1 & 9 & -15 & 1 & -3 & x^3+9x^2+6x-1 & \left \{ 2,5 \right \} \\\hline
63 & 2 & 3 & 12 & 2 & 1 & x^3-3x^2-18x-8 & \left \{ 11,2 \right \} \\\hline
63 & -2 & 9 & 12 & 2 & 3 & x^3-9x^2+6x+8 & \left \{ 11,2 \right \} \\\hline
117 & 1 & 9 & 21 & 1 & 3 & x^3-9x^2-12x-1 & \left \{ 2,7 \right \} \\\hline
117 & -1 & 12 & 21 & 1 & 4 & x^3-12x^2+9x+1 & \left \{ 2,7 \right \} \\\hline
117 & -4 & 3 & -6 & 4 & 1 & x^3-3x^2-36x+64 & \left \{ 5,2 \right \} \\\hline
117 & -4 & 9 & -6 & 4 & -3 & x^3+9x^2-12x-64 & \left \{ 5,2 \right \} \\\hline
171 & 2 & 9 & -24 & 2 & -3 & x^3+9x^2-30x+8 & \left \{ 5,2 \right \} \\\hline
171 & -2 & 15 & -24 & 2 & -5 & x^3+15x^2+18x-8 & \left \{ 5,2 \right \} \\\hline
171 & -5 & 6 & 3 & 5 & -2 & x^3+6x^2-45x-125 & \left \{ 13,5 \right \} \\\hline
171 & -5 & 9 & 3 & 5 & 3 & x^3-9x^2-30x+125 & \left \{ 13,5 \right \} \\\hline
279 & 1 & 15 & -33 & 1 & -5 & x^3+15x^2-18x+1 & \left \{ 2,11 \right \} \\\hline
279 & -1 & 18 & -33 & 1 & -6 & x^3+18x^2+15x-1 & \left \{ 2,11 \right \} \\\hline
279 & 5 & 3 & 21 & 5 & 1 & x^3-3x^2-90x-125 & \left \{ 2,5 \right \} \\\hline
279 & -5 & 18 & 21 & 5 & 6 & x^3-18x^2+15x+125 & \left \{ 2,5 \right \} \\\hline
333 & 4 & 9 & 30 & 4 & 3 & x^3-9x^2-84x-64 & \left \{ 17,2 \right \} \\\hline
333 & -4 & 21 & 30 & 4 & 7 & x^3-21x^2+36x+64 & \left \{ 17,2 \right \} \\\hline
333 & -7 & 9 & 3 & 7 & -3 & x^3+9x^2-84x-343 & \left \{ 2,7 \right \} \\\hline
333 & -7 & 12 & 3 & 7 & 4 & x^3-12x^2-63x+343 & \left \{ 2,7 \right \} \\\hline
387 & 1 & 18 & 39 & 1 & 6 & x^3-18x^2-21x-1 & \left \{ 11,13 \right \} \\\hline
387 & -1 & 21 & 39 & 1 & 7 & x^3-21x^2+18x+1 & \left \{ 11,13 \right \} \\\hline
387 & -7 & 3 & -15 & 7 & 1 & x^3-3x^2-126x+343 & \left \{ 11,5 \right \} \\\hline
387 & -7 & 18 & -15 & 7 & -6 & x^3+18x^2-21x-343 & \left \{ 11,5 \right \}
\end{array}