I am following along and reading this notes: https://www.maths.tcd.ie/~levene/221/pdf/cantor.pdf
I am having trouble understanding why we necessarily have $e_n=d_n+1$, $d_{n+1}= d_{n+2} =···= 2$ and $e_{n+1} = e_{n+2} = ··· = 0$ when $d_n > e_n$. It would much appreciated if someone can guide me through this.
You'll have to play around with the inequalities a little bit to establish that.
To make life easy, assume without loss of generality $d_1 \neq e_1$. Next, notice,
$$x = \sum_{n \geq 1} \frac{e_n}{3^n} = \frac{e_1}{3} + \sum_{n \geq 2} \frac{e_n}{3^n} \geq \frac{e_1}{3}$$
And also,
$$x = \sum_{n \geq 1} \frac{d_n}{3^n} = \frac{d_1}{3} + \sum_{n \geq 2} \frac{d_n}{3^n} \leq \frac{d_1}{3} + \sum_{n \geq 2} \frac{2}{3^n} = \frac{d_1+1}{3}$$
So, we have, $d_1 < e_1 \leq d_1 + 1 \implies e_1 = d_1+1$