i Believe hashirama beat madara but madara was just only fighting him to get his DNA but anyways theres some theories that hashirama had help BY SOMEONE like his wife mito beccause very soon after his fight with hashirama he is putting kurama under his controll so mito can seal him in her.