Hamiltonian formalism of Whitham-type hierarchies and topological Landau-Ginsburg models