In the UK, under the CAA (and as a CVn mentions, it may vary across EASA land, regardless of SERA), these are the rules:
The privileges of your licence will only remain valid if you have
completed, in the last 24 months, as pilot of an aeroplane or TMG:
At least 12 hours flight time as PIC, including 12 take-offs and landings; and
Refresher training of at least 1 hour of total flight time with an instructor.
That document also explains that:
A LAPL for aeroplanes will allow you to act as pilot in command (PIC)
on two classes of aircraft: either a single-engine piston aeroplane
(land) or touring motor glider (TMG) with a maximum take-off mass of
2000 kg or less, carrying a maximum of 3 passengers, with no more than
4 persons on board.
So I think that, in the UK, you can't act as PIC on a sailplane and so can't count any hours toward your LAPL
However, TMG flying is very cheap, if you can find one for hire