Its a bit hard to see how bad that rim is, but pitted steel rims are still a lot stronger than new alloy rims are,
and they survive well enough. Especially on a lightweight.
Rim probably needs sandblasting, so you can see exactly how much good steel is left.
Any holes right through the rim are probably beyond redemption, although I have seen someone mig up a few stray deep pits.
It really depends on how bad they are.
If the rim needs replacing, note especially the spacing and angle of drilling of the spoke holes.
That determines if a replacement will fit or not.
A lot of smaller trailbike rims will seemingly fit almost anything - note if they are 32, 36 or 40 spokes though !
hth.