Border Surveillance is one of the significant applications of wireless sensor networks (WSNs). Through communication between wireless sensors in the network, sensor barriers are formed to perform border surveillance. Since wireless sensors have limited energy and sensing capabilities, it is important to form sensor barriers energy-efficiently while guaranteeing the required surveillance quality. In this paper, we first define the surveillance quality of the sensor barrier by considering the maximum speed of the intruder and then propose a sensor barrier formation algorithm (ESBF: Energy-Efficient Sensor Barrier Formation Algorithm) that minimizes the number of sensors participating in the sensor barrier while satisfying the required surveillance quality using reinforcement learning. We perform a computer simulation to show that our algorithm is more energy-efficient than the existing one.