A section of the Mahābhārata narrates the story of Rāma. This section, called the Rāmopākhyāna, is far shorter than the Rāmāyaṇa which, as you correctly note, is a different epic altogether. The ...
Bhagavad Geeta 2:47
Source of Sandip's allusion
The passage Sandip alludes to is indeed from the Bhagavad Geeta. The exact source is Chapter 2, verse 47:
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन ।