No, you don't need to play the same thing that the MIDI file is playing.
If you let the MIDI file play the bass part that's programmed in the file, but also play a bass line of your own on the keyboard, it will be as though two bass players were playing in the band, which is perfectly fine-- after all, some bands have two guitarists, or two drummers, or two keyboardists, or two singers, so why not two bass players? Then you can play whatever bass line you want that sounds good with the song, and let the MIDI file play the "written" bass line.
Alternatively, if you're able to either turn off or just mute the MIDI song channel that the "written" bass line is playing on, you might want to play your bass line as closely as possible to the way it was written and recorded. But even then, you can play it however you want.
When one band covers a song that was recorded by another band, sometimes they try to play it as close to "note-for-note" as possible, but sometimes they play it totally different to give it their own flavor.
Even when a well-known band plays their own songs in concert, they don't always play them note-for-note the way they recorded them in the studio. I remember how scandalized I felt when I went to see ELP in concert for the first time and Keith Emerson didn't play all of the keyboard parts note-for-note like the records I loved so much. Oh, the horror! I was so young and naïve, and it didn't take very long for the shock to wear off so I could start appreciating the "live" versions despite all of their differences from the studio versions.
So don't feel like you must be able to play the song the way it was recorded or else you aren't very good-- just
get into the music, go all "Keith Emerson" or "Rick Wakeman," play what sounds good to you, and have fun.