A duality relation for certain triple products of automorphic forms