The banking group will close Ballantrae, Newmilns, Catrine and Cumnock Sanquar branches on September 12 and the New Cumnock branch on September 17.
A spokeswoman for RBS said: "The number of customers using these branches has dropped by, on average, a fifth over the last few years as more and more of them use alternative ways of banking with us. This includes by telephone, in Post Offices, by app and online.
"Over our whole branch network there has been a 30% drop in branch transactions since 2010 as people do their banking when and where it is convenient for them.
"We're investing £750m across the UK over the next three years to improve the way we serve our customers. This will include branch refurbishments, investment in digital banking and upgrading our ATM network.
"80% of our customers are within a three mile radius of a branch, and when you include the Post Office network that rises to 90% of our customers being within one mile of a place where they can carry out their every day banking."
The spokeswoman added: "We've advised staff and we're writing to our customers at all these branches to make them aware of the closure and the different ways they can still bank with us. If customers are concerned about how this will impact their banking, they can go into the branch where staff will be happy to discuss the alternative options available."