After Ceylon (as it then was) gained independence in 1948 there was no longer a British garrison there. However the British Army continued to provide support in helping to train the newly formed Sri Lanka Army by sending a British Army Training Team (BATT). Also some members of the Sri Lanka Army were sent to train in the UK, particularly at the Royal Military Academy Sandhurst and the Staff College Camberley for officers, and at the specialist trade training schools for other ranks. However by the mid 1950s this co-operation had been scaled down to save money which the Ceylonese government couldn't afford.
The Royal Navy continued to use its Trincomalee Naval Dockyard to support its Indian Ocean operations and the RAF had two airbases on the island up to 1956, when the left wing Bandaranaike government demanded that all British forces leave Sri Lanka. However Solomon Bandaranaike was assassinated in September 1959, so it's possible that the Sri Lankan government asked for military support from Britain during the ensuing internal unrest. Bandaranaike's widow subsequently became the world's first female prime minister.