Yes, both these sentences are correct. THe reason is as follows:
In the first sentence,"agreed" is a verb meaning to accept or have the same opinion on an idea.
In the second sentence, "agreed" is an adjective which can be used with a BE verb to mean "X and Y are of the same opinion or accept the same idea".
So, in fact, there is little real different in meaning between the two constructions, but one (#1) has more sense of action, while#2 has more a sense of status description (i.e., the agreement has already been concluded). So, when you want to express the action of agreeing, choose #1, and when you're reviewing what action has already occured, choose#2 to describe the situation.