The sea swept away the two boys.

The two boys swept away by the sea.
The sea swept away the two boys.

Are they grammatically correct?

The two boys were swept away by the sea.

The 2nd is correct.