In my use of the term "groundspeed", I'm thinking of that as movement parallel to the earth's surface, terrain disregarded.
That sounds very much like my own interpretation
Perhaps a bit more elaborated: "ground speed" might well be defined as the report between the time spent to travel between two coordinate pairs, and the "surface" distance between them, at an agreed "surface" standard like (for one example, but a quite likely candidate) WGS84. Such would be close to the thinking of the marine world, where non-military useage of GNSS orginated. As so often in history, aviators are only following in the track of mariners.
I don't know how real world ADS-B transponders do it.
Perhaps there is no general answer - it seems not impossible that one ADS-B set does it one way, and the other does differently.
Or, if they have to conform to certain standards to be certified - as I assume they should - then we should consult those certification standards. Perhaps a DAR has access to them (which I certainly don't)?