Surprisingly doable with the ubiquitous file
command:
$ file lossy.webp
lossy.webp: RIFF (little-endian) data, Web/P image, VP8 encoding, 1536x2560, Scaling: [none]x[none], YUV color, decoders should clamp
$ file lossless.webp
lossless.webp: RIFF (little-endian) data, Web/P image
The presence of VP8/VP9 data stream indicates that it is lossy