Though I was sleepy, I managed to finish my homework.
Literal
Sleepy was [but-けれども], homework [object-を] finish could-do.
終わらす is a transitive variant of 終わる — 'to finish [something].' (Compare 終える, another transitive form.) ことができた = 'was able to.' けれども is slightly more formal than けれど or けど. Triumphant-exhausted student mode.