Thank you all!
The flower heads look like knapweed or wild bergamot, but both these plants have smooth, soft, and well defined leaves.
Today, I went back and had a closer look at those plants. They have ragged, hard, and prickly leaves, like some thistles, so based on the appearance of leaves, I would think, it's some thistle variety.