Yes you need to separate them right now. They may well be brother and sister and inbreeding would not be good.
Did they come from a pet store?
If the female is pregnant, and there is a good chance she may be as they can act like this when expecting then you need to think of her welfare just now and feed generous good quality food and leave her very quiet to raise the babies. She would have litter after litter if you leave them together then the babies would have more and you will soon be over run with hamsters
They will be absolutely fine on their own and are telling you this now is their fighting.