I'm not sure about Arabic fonts, however Roman curvise/script fonts which also have joined letters also experience a similar problem when the letters join or overlap.
This solution is for Adobe Illustrator.
The first example below shows what happens when you try to apply a stroke to individual letters in the appearance panel. This is similar to your Arabic example.
The second shows what happens when you click and drag the stroke under the characters in the appearance panel. A slightly thicker stroke is required since half of the stroke will be hidden under the character fill.