Besides Hernandez, at least three people were wounded by the shooters.
All the victims were taken to hospital, however, Hernandez sustained serious injuries and died later in the day, the broadcaster said.
Before announcing the mayoral bid, Hernandez was a member of a local self-defense group operating against the Knights Templar Cartel drug cartel in Michoacan. The criminal organization is notorious for large-scale drug trafficking, murders and kidnappings.
On June 7, Mexican voters will elect 500 members of the lower chamber of Congress as well as governors in nine of 32 states and about 900 mayors.