Generalized Umemura polynomials and Hirota-Miwa equations