1)To be married legally in Mexico you must have a civil wedding officiated by a recognised government officer.
2)To be religiously married - it is the venue of your choice.

You cannot do 2 only. You can do 1 only.

If the wedding does not meet criteria 1 it is not legal.