Off-spinner Ramesh trapped Yasir lbw for 26 to record a third five-wicket haul in his 10th Test to wrap up the innings.
Agha Salman remained Pakistan's top scorer with his fighting 62 on Monday.
Sri Lanka skipper Dimuth Karunaratne will bat in the second innings only if required, the team said.
He failed to take to the field in the Pakistan innings due to "lower back pain", and Dhananjaya de Silva stood in as captain.
Wicketkeeper-batsman Niroshan Dickwella returned to the crease alongside Oshada Fernando, with the hosts looking to bounce back from their opening loss in the two-match series.