I am not familiar with your board/device, but I've achieved non-GPIO LED control through MDIO, see: Ethernet LEDs control for TP-Link TL-WR1043ND v2/v3
Has both a C program that makes use of ioctl calls and mdio-tools, like your example.
If the value is not sticking, it's likely getting set back to the former value by something else, like the driver.