Ali, arguably the most prominent U.S. Muslim, made his appeal in a letter to Iran's top religious leader, Ayatollah Ali Khamenei.
He asked Khamenei, as a brother in Islam, to show mercy and compassion for Americans Josh Fattal and Shane Bauer.
Fattal and Shane were arrested while hiking in northern Iraq near the Iranian border. A third hiker, Sarah Shourd, was released on bail in September.
Ali also wrote a letter to Khamenei shortly before Shourd was released, though it was unclear whether it had any effect.
The trial for the three Americans began in February, and they pleaded not guilty to the espionage charges. Shourd pleaded not guilty in absentia.
The second session of the trial is scheduled for May 11 in Tehran.
The U.S. government has denied the charges against the hikers and demanded their release. Their lengthy detention has added to tensions between the two nations over issues such as Iran's disputed nuclear program.
The Associated Press contributed to this report.