Why were the majority of the railway semaphore signals replaced with the coloured light signals as seen today?

Also, I would just like to know why some of the railway semaphore signals are still being used in some parts around the world.

Best Answer:

?: Semaphore signals are mechanical by nature. They were also originally operated by wires running over pulleys between the signal box and signal, and thus could not be situated more than about 1000 yards to either side. Therefore, a great many signal boxes are needed on any length of running line to keep the "block sections" – the length of track from the "starting" signal of one signal box to the "home" signal of the next one – as short as possible for the density of traffic. The main principle of "Block signalling" is that only one train is allowed into a block section at a time, and it has to proved that it has passed right through it before the next train can follow.

The majority of signal boxes were at stations, which are spaced at inconsistent intervals. It was therefore necessary to provide additional signal boxes in between to break up the longer sections into two or more shorter ones. On any length of main line, the frequency of the trains is dictated by the length of the longest block section on it.

The signal boxes also controlled the turnouts, junctions etc., by means of solid metal rodding running on rollers, with bell-cranks and so on. It was impossible to operate turnouts any further than about 250 yards from the signal box so – at the other end of the scale – complex stations and junctions needed two or more signal boxes with no actual block sections between them. By the early 1900s it was possible to use power operation of turnouts and signals, which meant that the signal boxes could operate them at longer distances. This enabled a number of signal boxes to be abolished.

However, the advent of powerful colour-light signals, with no moving parts, meant that large areas could be controlled from one signalling centre at far less expense than providing numerous signal boxes and the staff to man them. The signals can be spaced more-or-less evenly on plain track, and in connection with track circuiting the old "Absolute Block" system is thereby abolished, as the block sections are effectively the track between one signal and the next.

Other answer:

When you're operating a 100 car train that weighs in at thousands of tons, it takes a bit of distance to slow down or stop. Colored light signals are used because they can be seen from further away than semaphores.
Reliability and lower maintenance costs were the main reasons. I work on a line that was one of the last in the country( El Paso to Tucumcari NM Eastline) to still have semaphore signals. They were always having to come out and work on them due to their complex mechanical operation. There's still a couple of them laying out in the weeds along the right of way where they were tossed when they removed them.
United Statesian Not American:
Define semaphore. I lost you there. All I could think about what was "semaphore, what a weird word. Why??"