How do I handle this assignment?
Your options are:
b) Tell the company you won't do any non-Java assignments. Get fired.
c) Tell the company you won't do any non-Java assignments. Get only Java assignments.
From the outside, two of those look particularly bad on resumes (short, incomplete stint as a trainee) and the third one looks like the company is pigeon-holing you in one area of code. If the company later decides to convert all their code from Java to C#, you'll be out the door then anyway.
In my current company I'm working with several different systems - 2 are in C#, one is in PHP and one is in Java. I would not have been hired if I couldn't handle working in multiple environments with multiple languages. (Incidentally, we're porting our remaining Java code to C# so that we can remove several of our Linux boxes and consolidate the code on our Windows machines.)
Several jobs ago I worked on both a modern C# app and a legacy VB.Net app. I ended up being the go-to guy for the VB code, and when they finally retired that code I was given an award for keeping it running as long as I had.
Your goal here is to become a better programmer. Especially as a trainee, your opinions of "Java is the only language worth learning" will hold no water. Once you're a team lead, creating new programs from scratch, you'll be able to weigh in on what languages to use, but by then you'll also be able to say why one language is better than another for a given task.