Sadly filling the gap between the main window and the additional one with foam or bubble wrap will not reduce the noise levels from the railway line.
To begin to be effective against airborne noise the gap between the additional window and original double glazed window would need to be of the order of 10 to 20cm. The reveal to the gap would also need to be lined with sound absorbing material in order to damp the resonance of the enclosed air space.
To maximise any sound reduction improvements gaps or cracks (no matter how small) around the windows also need to be sealed and made air tight.
Is the gap too small?
Is this your own property?
If so you could consider building a wooden sub-frame of suitable depth say 15cm around the window opening and then remount the secondary glazing unit on this. Again strict attention needs to be paid to sealing of any leakage points.
DIY how to tutorial projects and guides - Did you know we have a DIY Projects section? Well, if no, then we certainly do! Within this area of our site have literally hundreds of how-to guides and tutorials that cover a huge range of home improvement tasks. Each page also comes with pictures and a video to make completing those jobs even easier!