How should I handle colleagues, especially seniors/superiors, who generally do not contribute much towards a project, but jump in from nowhere at the correct time to take credit?
There's a difference between 'taking credit' and 'getting credit.' The way to combat those that Take it is to Get it. You get credit by continuing to do good work, documenting your contributions, communicating effectively and gradually increasing the scope of your influence and responsibilities. People who are in a position to Give credit should eventually see your contributions and provide the feedback you're looking for.
For example, if you're working on Project X and a notorious credit stealer is responsible for attending a status meeting on behalf of the team, see if you can volunteer to also attend the meeting and provide your own status. Or further, you can volunteer to take over the responsibilities of attending the meeting under the guise of 'professional advancement.'
The last thing you want to do is try and make a public spectacle of the situation as it makes you look petty and has the exact opposite impact you're hoping for.
Make sure the credit for the work you do is coming to you. You don't need to be a glory seeker, just stand up for yourself.
If the person who is claiming credit is speaking outright lies, do what you think is right given the situation. Regardless of what happens, you need to be working in a place where you feel that what is right is the thing that usually wins, whatever the method or culture in your workplace. When you stick up for what you think is right, there will, of course, be consequences. Usually you'll find that those consequences either encourage others to speak out against something that they also think is wrong, or it gives you the feedback and direction you need to know that maybe you want to work in a company culture that's different than your current assignment. Company cultures are as diverse as the people who work within them, so there's plenty of choices.