She ran two miles at most.

what is function of "at most" in this sentence?

It means, "the farthest she ran was two miles". It's used to make the suggestion that someone is not being completely honest.

Carol: I ran three miles.

B: [to C] She's full of it. She ran, at most, two miles.
It's a prepositional phrase, and it quantifies "two miles".