Swords were used by samurai horsemen when charging, even those who shot from horseback. Men on foot drew swords probably only after they lose their polearm, or in emergency if the enemy goes past the point, or to take heads.
Now to address the questions, the transition from a focus on horsemen to a focus on foot took place quite abruptly just prior to the Ōnin War. The focus on polearm as the predominant close-quarter weapon only increased.
The reason for this is the increased mobilization potential of lords. Unlike in the Kamakura when the newly created lords of provinces (shugo) had to struggle with other officials appointed by the court over the control of the provinces, in the Muromachi the shugo was unequivocally the lord of his province. He was also given the rights to take half of all tax revenue from the province in a new tax called hanzei (half tax).
With an increase in resources means increase in both bureaucratic control and mobilization potential. This allowed an important transition that allowed infantry-based armies. Originally, foot soldiers were from ad-hoc levies of the complete amateurs from across the province, who have never trained or faught with each other. These men would never stand against a charging horsemen. But now men could be called upon with some regularity, causing them to become semi-professionals attached to a local strongman/samurai. These semi-professionals were raised into local small units that could spend some time to train together. As long as these men had enough training to stand fast with their polearm in formation against charging horsemen, then in a field battle horsemen has no hope of breaking these infantry formation by themselves. I believe similar transformation was seen in high and late Medieval England and France. This caused some surprising upsets early in the Ōnin War.
To be sure, horsemen continued to play important roles in warfare in Japan. But from now on men on foot made up of increasingly larger part of the army until they made a clear majority of a Japanese army.
Thomas Conlan's Weapons & Fighting Techniques of the Samurai Warrior 1200-1877 AD