I've recently made a custom model for the powered rail using multipart to define each state of the block with a model, but I encountered a bug where the model does not apply multipart when it is not on a transparent block.
Step to reproduce:
Use Minecraft 1.17+
Make a resource pack
Place the powered_rail.json into /blockstates/
Unzip the content of rail.zip into /model/block/rail
Place the rail_special texture in /textures/block/
Reload the resource pack
Place a powered rail on a glass block & on a stone block (they need to have the same tags)
See:
Please attach the full resource pack