Rishi Valmiki who wrote the Ramayan was a contemporary of Shri Rama. The fact that he wrote the entire epic in Sanskrit points to the fact that it was the spoken language in those days. Same logic applies to the Mahabharat as well which was composed by Rishi Ved-Vyas & narrates the life-stories of his grandsons the Kauravs and Pandavs.
Also, Pali and Prakrit, the derivatives of Sanskrit didn't come about till much later. The INTRODUCTON TO PRAKRIT by Woolner, Alfred C. (Alfred Cooper), 1878-1936 states that:
So if Prakrit became the lingua franca close to the 3rd century BCE, we can safely assume that yes Sanskrit was the spoken language at the time of the epics the historical dates for which vary from 5th Millenium to 2nd Millenium BCE (5000 BC to 1500 BC) but not the 3rd century BCE (300 BC).