Is there a substance that would react with seawater to produce a dense, insoluble, nonporous precipitate?
A superabsorbent polymer sounds appropriate for this application, and the wikipedia article suggests they are used for "blocking water penetration in underground power or communications cable".

Will the water be removed from the pipe again after it has intruded, and if so do you need the seal to remain impermeable? I would expect this kind of polymer to dry out and shrink with time in the absence of water and it would not necessarily then be able to swell again with the same performance.