usa – six-month rule bypass if already in the country

Two of my families have just arrived at Jorge Chavez International Airport in Lima, Peru (USA) for a holiday (tourism), but one of them has a passport that expires in two months. Peru complies with the six-month rule for the validity of the passport. This was not known to us so far.

Customs (in Peru) are no longer allowing them to enter the country. From what I read online, there is no circumvention of the rule, and often people are not allowed on board. What is the best way to deal with this situation (hopefully continue the holiday as planned)?

(If it makes a difference, they first travel from JFK (NYC) to Bogota, Colombia and then from Bogota to Lima.)