The Hebrew and Arabic scripts are not at all related to ancient cuneiform.
Cuneiform writing began as a pictographic script and was in use by the various Mesopotamian kingdoms from around 3500 BC to around 900 BC. It was then gradually phased out during the Neo-Assyrian Empire (ca. 900–600BC) in favour of the 22-character alphabet that had been used by the Israelites, Phoenicians and other Canaanites since around 1500 BC (finally abandoned around 100 BC)—because that was clearly more efficient and easier to use.
In the hands of generations of Assyrian scribes, the forms of the Canaanite letters gradually evolved into a disciplined, graphically efficient set of characters that acquired its own name—the Assyrian or Aramaic script. Here’s an example, from around 515 BC:
When the Judean aristocracy was exiled to Babylon around 575BC, it was so impressed by the Aramaic script that, on their return to Judea around 500BC, they adopted it (after much deliberation) as the new official script for Hebrew. Since the Assyrians had only changed the forms of the characters and not their names or functions, this was technically easily done—although officially abandoning the traditional old script that had been used by the Israelites for over a thousand years caused much anguish among the Jewish Sages (which has since been forgotten).
The same Assyrian script was adopted by the Nabateans, and the Arabic script subsequently developed from that.
(See this and other answers to this question at Quora.com)