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.
It seems ridiculous that there is absolutely no way to tell whether a track belongs to a specific group. One can find out whether the track belongs to a group via "current_output_routing", but not to what group it belongs to.