I estimated the mean and variance of two latent variables through two groups of data. I can't use the data to do hypothesis testing, because I am interested in the latent variable. Is there a way to test the whether the two latent variables are significantly different?
The difficulty of your quest seems to lie in the uncertainty of prior distribution of the latent parameters. For instance, in paired T-test for Gaussian distributions, the prior distribution of $\mu$ is irrelevant, since the Gaussian family is translation invariant. In the case of Gamma, the mean matters a lot. Perhaps the best way is to estimate the gamma parameters for one of the two samples as you did in your linked question, and compute p-value of the other sample under this distribution.
If you've estimated your latent variables through something like confirmatory factor analysis, item response theory, or some other kind of structural equation model, you should be able to estimate factor scores for individuals. Factor scores are usually interval data. These can be plugged into most hypothesis tests without any particularly unusual problems AFAIK. McArdle (2009) also describes some ways to do tests of latent mean differences within structural equation models, though he presents it in a longitudinal context.
McArdle, J. J. (2009). Latent variable modeling of differences and changes with longitudinal data. Annual Review of Psychology, 60, 577-605.