Having prevailed by 10 wickets inside three days in the series opener, Australia looked primed for a second successive series victory in Asia following their triumph in Pakistan earlier this year.
Electing to bat, the tourists were in great shape at 329-5 in the first innings but they lost their last five wickets quickly to be all out for 364 with Steve Smith stranded on 145.
Alex Carey missed a couple of stumping chances and Australia paid heavily for wasting three reviews as Sri Lanka amassed 554 in their reply.
The visitors were stung when Dinesh Chandimal, then on 30, edged behind but Australia had run out of reviews and could not challenge the not-out decision.
Chandimal went on to smash a career-best 206 not out.
“We had plenty of chances over the last couple of days and didn’t quite grab them,” Cummins said after their loss.
“Unfortunately Sri Lanka were too good.”
“We probably got ourselves in a position where 400-plus in the first innings was achievable and we didn’t have someone to go with Smithy down the other end.”
Australia are scheduled to tour India next year and Cummins said the Sri Lanka tour was an excellent exposure in their bid to succeed in subcontinental conditions.
“These are the tours where you learn heaps. We learned heaps during our win last week, unfortunately it’s through a loss this time.
“I thought a lot of the guys, either on their first tour here or others who were coming back, everyone found a method that worked – unfortunately it didn’t work out today.
“As a batting and bowling group, I think we can go home pretty pleased.”
Sri Lanka counterpart Dimuth Karunaratne was pleased how his team bounced back to level the series.
“We knew it would be a good wicket for a couple of days, that’s why I asked the batters to get the maximum out of that.”