Railway is one of the ground transportation modes that has characteristics and advantages more efficient compared to other ground transportation modes. However, accidents at railway crossings remain a serious issue. To reduce accidents between trains and road users at level crossings due to negligence or errors in the system, or due to road users' lack of discipline, there is a need for automatic crossing barriers, such as the use of automatic railway crossing gates integrated with components, making it safer and minimizing the possibility of road users attempting to pass through railway gates when they are closing. This research employs arduino UNO components, HC-SR04 ultrasonic sensors, FC-51 infrared sensors, DC motors, L2986N motor drivers, 16x2 LCD with I2C module, LEDs, power supply, and an emergency stop. The railway crossing gate system is designed with a working principle using sensors to detect trains and objects around the crossing. Testing of the ultrasonic sensor successfully detected trains at a maximum distance of 5 cm, with angles of 20° and 30° providing optimal initial detection. The infrared sensor showed rapid response to approaching objects, and using PWM duty cycle 27,4% provided optimal performance for the gate's sliding movement. Additionally, testing of the LED, LCD, buzzer, and emergency stop button functioned according to their purposes. The overall testing results of the system concluded that the design of the railway crossing gate system was successfully integrated to enhance safety at railway crossings and optimize train operations. Keywords: Railway, Accidents, Crossing Gate, Ultrasonic Sensor, Infrared Sensor, and Safety