Arrows are blocked by walls and defenses like Hoarding.
If your units are too close to the walls, they won't be able to arc their arrows to hit the units on top. Try changing the position of your units and/or spending Skill Points to increase their range.
Don't just rely on Rangers, though. Try sending in Treants to attach to the walls and have your Sentries and Blademasters scale them to take out the defenders, while your Rangers pepper them with arrows from a distance.
All infantry units should be able to climb towers, sometimes their path might be blocked by other units though.