The class don't seem to have had much action and as far as i can tell, were seen at the time as being less effective than the RN's other battleships. So why retain ships with such limited use when the RN could have used the manpower elsewhere?
In the early 1930s, the Royal Sovereigns were not projected to survive later than 1942. The Washington Naval Treaty set firm limits on the amount of battleship tonnage the major navies could build. It also set a 10-year building holiday, in which no new battleships could be built. This was extended to 1936 by the 1930 London Naval Treaty. New ships could be built starting in 1936 to replace older ships, which would be scrapped when their replacement was complete. Under this regime, the RN planned to scrap two Royal Sovereigns in 1940, two more in 1941 and the last of the class (plus one Queen Elizabeth) in 1942.
However, the Second London Naval Treaty of 1936 removed this requirement. Now it was worthwhile to keep and modernise older battleships like the Royal Sovereigns. This was especially true for the Royal Navy, which had to face the rapidly expanding German Navy in the North Sea and Atlantic, the Italian Navy in the Mediterranean and the Japanese Navy in the Pacific. In 1939, the RN's planning department projected that by 1943-44, the German Navy would have ten capital ships available, while the Japanese would have sixteen. Against this, the RN could commit ten to the Atlantic and only twelve to the Far East. Three of the ships sent to the Pacific would be somewhat modernised Royal Sovereigns - the other two ships, for which time, money and dockyard space for a refit was not available, were to be scrapped.
The start of WWII again changed this calculus. The new, modern battleships of the King George V class were yet to complete in 1939, and their follow-ups in the Lion-class had only just been laid down. Most of the Royal Sovereigns had not received their planned modernisations, with only Royal Oak having been upgraded. Even so, given the lack of modern battleships, they were still useful. While they were slow, poorly protected against air attacks and outgunned by modern battleships, they could still make marks in secondary roles. They were very useful for protecting convoys against German surface raiders. While they were no match for a Bismarck-class battleship, they could still serve as a deterrent against them, and outgunned the smaller German classes. Raiders would avoid convoys with a battleship escort, as fighting one risked taking critical damage which would cut a raider's cruise short. They were useful for shore bombardments, which did not need a fast or heavily armoured ship. Revenge bombarded Cherbourg in 1940 to disrupt German preparations for an invasion of Britain. Resolution took part in Operation Menace, the failed invasion of Dakar in September 1940. Ramillies assisted with Operation Ironclad, the 1942 invasion of Madagascar, and took part in the D-Day landings. Finally, the Royal Sovereigns could just make up numbers where other British ships were lacking. A bad battleship was better than no battleship, after all. This was commonly done in areas of secondary importance; the Mediterranean in 1940, or the Indian Ocean in 1942. They were withdrawn from these roles as the threat slackened, with the Japanese and German fleets being whittled down and the Italian Navy switching sides, and as more modern ships became available.