No confusion
The first can mean all fruit is banned, because "fruit" is a mass noun and as such does not have a plural form.
The second clearly refers to one song, just like the headline refers to one newspaper.
Re:Tanzania bans newspaper for 2 years
by idle_processor on Saturday June 17, 2017 @04:59PM
(#14577728)
"Song" can also refer to the act of singing, so the second one still read ambiguously to me.
The rules for newspaper headlines is not the same as for normal sentences.
> "Tanzania bans song for two years"
That's ungrammatical as a sentence but a perfectly good headline.
It's not ungrammatical. You're just expecting a different usage of the word song, so it looks wrong.
Had it been "Tanzania bans song and dance for two years," you wouldn't have batted an eye.
"Tanzania bans fruit for two years"
"Tanzania bans song for two years"