“In the thirty-seventh year of King Joash of Judah, King Joash son of King Jehoahaz began to reign over Israel in Samaria. He reigned sixteen years. He also did what was evil in the sight of Yahweh. He did not depart from all the sins of King Jeroboam son of Nebat, by which he caused Israel to sin, but he walked in them.”
So like the 2 kings named Jehoram, for about 2 years there were 2 different kings named Joash in Judah and Israel. King Joash of Israel ruled for 16 years, while young King Joash of Judah had ruled for 40 years. This Israelite king walked in the ways of the evil King Jeroboam, causing Israel to sin.