A method for filling at least partially the gap between a stock rail and a switch rail in a railway switch, in particular for preventing the railway switch from being blocked by accumulation of materials such a snow and/or dirt in said gap, in which method at least one compressible sealing element, which comprises at least one piece made of a resilient foam, is inserted in said gap, which sealing element has a top surface, two opposite lateral surfaces and a bottom surface, with a rectangular cuboid circumscribing the sealing element and having a top face tangent to said top surface, two lateral faces tangent to said two lateral surfaces and a bottom face tangent to said bottom surface having, in the uncompressed state of the sealing element, a predetermined total volume,
- wherein said foam has an open-cell content of at least 50% and such a hardness that it requires a force of less than 2000 N to compress the sealing element per meter length thereof in a direction perpendicular to the lateral faces of said rectangular cuboid until the total volume of the rectangular cuboid circumscribing the compressed sealing element is reduced to 60% of said predetermined total volume, and
- wherein the sealing element comprises a water-impermeable cover layer which extends at least over said top surface.