A jury has been told that two men accused of murder were seen wielding knives seconds after a fatal stabbing.