I believe this formula is true, provided the $\alpha$ in the second sum is changed to a $\beta$, as suggested by Todd Trimble's comment. Let
$$ P(x) = \prod_{n=1}^\infty \frac{1}{1-x^n} $$
be the generating function for the number of partitions of a non-negative integer $n$. Dedekind proved that $P$ satisfies the transformation formula
$$ \log P(e^{-2\pi t}) - \log P(e^{-2\pi /t}) = \frac{\pi}{12} \Bigl( \frac{1}{t} - t \Bigr)
+ \frac{1}{2} \log t $$
for $t > 0$.
Differentiating this formula with respect to $t$ gives
$$ -\sum_{n=1}^\infty \frac{2\pi n}{e^{2\pi n t}-1} - \frac{1}{t^2} \sum_{n=1}^\infty \frac{2\pi n}{e^{2\pi n/t} -1} = \frac{\pi}{12} \Bigl( -\frac{1}{t^2} - 1\Bigr) + \frac{1}{2t} $$
Now multiply through by $-t/2$ and substitute $\alpha = \pi t$, $\beta = \pi /t$ to get
$$ \sum_{n=1}^\infty \frac{\alpha n}{e^{2n\alpha}-1} + \sum_{n=1}^\infty \frac{\beta n}{e^{2n\beta}-1} = \frac{1}{24}(\beta+\alpha) - \frac{1}{4}$$
which is Ramanujan's formula.
The transformation formula for $P$ is related to the theory of modular forms, of which
the Eisenstein series mentioned in Derek Jennings' answer to your question on math.stackexchange are important examples. Briefly, if we define
$$ \eta(\tau) = \frac{e^{2\pi i \tau/24}}{P(e^{2\pi i \tau})} = e^{2\pi i \tau/24} \prod_{n=1}^\infty (1-e^{2\pi i n \tau}), $$
then $\eta(\tau)^{24}$ is a modular form of weight $12$. As such, $\eta$ satisfies the identity
$$ \eta(-1/\tau) = \sqrt{-i \tau}\; \eta(\tau). $$
The transformation formula for $P$ follows by setting $\tau = it$ and taking logs.