The increasing complexity of autonomous vehicles has exposed the limitations of many existing control systems. Reinforcement learning (RL) is emerging as a promising solution to these challenges, enabling agents to learn and enhance their performance through interaction with the environment. Unlike traditional control algorithms, RL facilitates autonomous learning via a recursive process that can be fully simulated, thereby preventing potential damage to the actual robot. This paper presents the design and development of an RL-based algorithm for controlling the collaborative formation of a multi-agent Khepera IV mobile robot system as it navigates toward a target while avoiding obstacles in the environment by using onboard infrared sensors. This study evaluates the proposed RL approach against traditional control laws within a simulated environment using the CoppeliaSim simulator. The results show that the performance of the RL algorithm gives a sharper control law concerning traditional approaches without the requirement to adjust the control parameters manually.