"At 31, am I too old to become a LEO?"
No.
As for the federal cut off...
It is tied to the benefit packages.
Some federal law enforcement positions have benefit packages with mandatory retirement at age 57. Those benefit packages require a minumium of 20 years of service to fully vest, therefore requiring that you be hired by age 37.
Many federal law enforcement positions have other benefit packages with no mandatory retirement age. FLETC has graduated folks in their 70s and 80s. No comment on whether I think that is a good practice or not. Their agencies apparently wanted them, and they got them.
Visit
www.usajobs.gov for more information on available federal LEO positions.
Search hints:
Prep a resume with their builder to have ready when you'll need it.
Always search US for the location.
Mix up your searches (basic, agency, series, etc) for best coverage/results.
Search every week, Tuesday through Thursday, to catch all the announcements.
Search "investigation and inspection" using the basic search.
Occupational series of interest to prospective LEOs: 1801, 1811, 1881, 1895, 1896, 0083, 0085... there are others.
Best of luck - Erik