Well, the loco should be under load so it's drawing hard.
You have to rate the cap voltage over anything expected, including spikes at blocks, etc..... 35v aught to keep it from popping; 50v safer yet. Bigger uf is better, but you can stack a bank of them if you wanted. Ac still goes to the relay's coil. Ac goes to the rectifier first, cap on the dc side, + to +; - to -, dc- to whistle, dc+ to the relay point A, relay point B to whistle motor+.