Citizens from the following countries who wish to visit Mexico as tourists, in transit, for business, technical activities, as journalist or for studies, for a period not exceeding 180 days, and who will not receive any remuneration at all in Mexican territory, do not require a visa:
Andorra, Argentina, Australia, Austria, Bahamas Barbados, Belgium, Belize, Brazil, Bulgaria, Canada, Chile, Colombia, Cook Islands, Costa Rica, Croatia, Cyprus, Czech Republic, Denmark, Ecuador, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Iceland, Ireland, Israel, Italy, Jamaica, Japan, Latvia, Lichtenstein, Lithuania, Luxembourg, Macau, Malaysia, Malta, Marshall Islands, Micronesia, Monaco, Netherlands, New Zealand, Niue, Norway, Palau, Panama, Paraguay, Peru, Poland, Portugal, Romania, San Marino, Singapore, Slovakia, Slovenia, South Korea, Spain, Sweden, Switzerland, Trinidad and Tobago, United Arab Emirates, United Kingdom, United States of America, Uruguay, Venezuela.
All foreign visitors, regardless of their nationality, traveling to Mexico for tourism, business or in transit to another destination, are exempt from presenting a Mexican visa as long as they have a valid visa issued by any the following countries: Canada, Japan, the United States of America, the United Kingdom or any of the countries comprising the Schengen Area.
In addition, foreign visitors who, regardless of their nationality, have a valid permanent resident card from Canada, Chile, Colombia, Japan, Peru, the United States of America, the United Kingdom or any of the countries comprising the Schengen Area, do not require a Mexican visa.
You will see that Sri Lanka is not listed, so unless you qualify for one of the other exemptions, you will require a visa.