If you have your flights booked under KL flight number, you should have lounge access in both AMS and MLA and you will earn miles and XP in FB.
And yes, what you describe is always the case when flying code-shares outside the alliance of the marketing carrier.