Hey, how I would do this would be by using collision checks. Player has a collider and flag has its own collider. Also both player have its own tag (player can be tagged mainPlayer, Flag can be tagged flag). Create an FSM in the flag and make an event called playerPickUp
Next create a new state with the action trigger Event on the flag. You can use On Trigger Enter since the player runs up to it to pick up. The collide tag would be mainPlayer since that is what you want to be able to pick it up and the send event would be playerPickUp. The second state would be giving the player the flag and making the flag that was at the location to disappear.
I would use 2 send events telling for the flag and the mainPlayer. For the flag you would have this in a new FSM with two states, the listen (Start State) and the other state being flagGone (give this state a Global Event called flagTaken) and on this state you want to remove the flag.
You would do the same for the mainPlayer but instead of removing the flag you would have the flag already on him and enable it. You can do this with a bool Check. So it goes to its second state has an action that is called Set Bool Value, and enable a bool you would create specifically for if the player is carrying the flag. You can also use this bool point saying if true when player reaches spawn point give point in a game manager FSM. Or if player is killed and the flag bool was true return flag to origin.
So mainly playing around with that and I'm sure there are plenty of ways to do it but this is just one approach.