Enumeration of singular hypersurfaces via tropical geometry