In factorio 0.16 the heavy tank mod does have an equipment that requires the insertion of fuel into it - I imagine doing the same with ammunition would not be hard.
On the technical side, you could always set the input energy limit to 0 and only add energy to the equipment when consuming bullets from the inventory (or an integrated slot) via a control.lua script.
The animation side might be harder to implement - does factorio allow a post-data phase modification of sprites? If not, you'd probably need a ghost entity that is position synced to the train and renders above it for every possible turret, and create or destroy them in equipment change events.