We consider the WDVV associativity equations in the four dimensional case. These nonlinear equations of third order can be written as a pair of six component commuting two-dimensional non-diagonalizable hydrodynamic type systems. We prove that these systems possess a compatible pair of local homogeneous Hamiltonian structures of Dubrovin--Novikov type (of first and third order, respectively).