The men, who were sunbathing on a beach south of Sydney, were found after they called for assistance.
They were fined A$1,000 (US$750; £547) for breaching a public health order banning those in greater Sydney from travelling outside the area.
The city is under lockdown as it battles the contagious Delta variant.
"It's difficult to legislate against idiots," NSW Police Commissioner Mick Fuller said at a press conference on Monday when speaking about the incident.
"Clearly putting people at risk by leaving home without a proper reason, and I think then on top of that, getting lost in the national park and diverting important resources away from the health operation, I think they should be embarrassed."
According to a police statement, the authorities had located a 30-year-old man naked and carrying a backpack on the walking track near Lady Wakehurst Drive in the Royal National Park in Otford.
After a further search, which included the help of a helicopter, they then found a 49-year-old man, who was partially clothed.
The men told officers that they were on a nearby beach when they were startled by a deer and ran into bushland.