No way to tell if a track is in a group or not, strictly from the API
The only way to tell if a track is in a group is by looking at the output routing. If it is set to “Group”, then the track is necessarily grouped. However, it’s possible to change the output of a grouped track to something other than “Group”. In that case, there is no way to tell if the track is grouped or not, strictly from properties available in the API.