If you get the right general skills and upgrades you can even have your ashigaru archers tank most of the melee fights.
Even on legendary difficulty.
The general skill you should beeline for is the infantry leader (the one that gives "stand and fight" ability, then +1 to melee dmg to all units then + 3). What I do for all my generals is to put 1 point into strategist at first lvl, then 2 points into poet on second level up, then 3 points into infantry leader on third level up. That's just a loose guidline but having 3 points into infantry leader is pretty amazing.
With stand & fight ability on, the archers within general's influence circle will get 20+ reload and some extra melee damage... so even your ashigaru archers can have awesome 50+ reloading skill with near 10 melee damage.
The upgrade you should go for is mainly the armor upgrade. Samurai archers can be trained on provinces with fletcher building for extra accuracy, but you want to pump out your ashigarus with extra armor since otherwise they die way too fast. The maximum number of extra armor you can get is +3 from armorsmith (need iron to make it +3, without iron, +2) and +2 from armory varient of encampment building. That can mean 7 armor yari ashigaru or 14 armor naginata samurai. With 14 armor naginata samurai they can take a full volley from archer unit and only lose about 3 ~ 5 men even when they are in tight formation.
Of course elite melee specialists will beat your archers in melee, but they can now buy you enough time for you to make a proper flanking charge.
But why would you want your melee line to be held by mere ashigaru archers? Because if your archers can fullfil the roll of both archers and basic melee unit as a single unit, that means your melee line can get longer than the AI who only uses melee units to melee. Longer melee line = super easy flanking. That and now you can safely field archer-heavy army which is pretty easy to mow down the AI army with while taking relatively low casualty. With the general skill and upgrades I mentioned above, I use armies that have 10+ archers and it's not unsual for a whole unit of katana samurai to be destroyed completely before they make their charge.