Digital signal interfering with analog signal and creating false triggers
The longer inductive wires act as antenna to the DCC E and H fields caused by voltage &amp; current pulses.

The best solution is to add CM chokes around a twisted wire pair to the audio chip with decoupling cap across the audio chip, not the switch.

The next best is to just put 0.1 to 1uF ceramic caps direct across the sound chip. These are cheap and can be bought in bulk from Digikey , RS, Future Active, or Mouser etc.  Cut leads and solder to,chip. If it already has 0.1 uF caps, then move up to 10uF tantalum.  You can get axial or radial parts &lt; 1/4" or any size you want.

Keep in mind if the switch is rated for >2A , it is not gold plated and will fail from oxidation over time and the polarized  tantalum cap will provide the 10% wetting current needed to burn off oxide.with a low current sound chip. (piezo)

But thinking about it, you probably have micro switches and these are just high impedance logic signals so 0.01 to 0.1uF ought to do it.

In future only use twisted pairs for every thing to reduce EMI in both directions. sender/receiver.