There even exist other and better ways "in group" to detect the real distance to the group member (if on the same map/zone. For everything else wookifriseur already mentioned IsUnitInGroupSupportRange e.g.).
But as I said in my initial post: There won't be any easy way to create such an addon!
It would need either several libraries that handle that distance and other things (LibMap*), and/or data sharing in group (where both players need the same addon enabled) via LibGroupSocket e.g.
Plus checks for IsDead, IsMounted and and and
It should be possible to craete such an addon if you have the will and time, but I for myself will not do so as I'm lacking the time and won't create addons for 1 player only
(no offense tdc-nl, but your usecase is kind of strange to me. Do you play in 1st person mode and cannot see the passenger behind you because of that? Then maybe use existing addons that change view of sight via a keybind shortly so you get to 3rd person and see if the pessenger is on your mount or not?).
If anyone else wants to create such an addon, feel free to spy my FCOAccessibility addon which does group member distance and position checks already.
But that was designed for visibly impaired players and thus only works in accessibility mode of ESO. Though the code should be the very same.