2-adic valuations of certain ratios of products of factorials and applications