Genus-2 G-function for $P^1$ orbifolds