My dash had vinyl glued to it that had a black foam backing. The foam had deteriorated and the vinyl was loose. It was glued to the metal dash. Might be a similar product. I scraped it off with a putty knife and covered the dash with carpet.
On a ceiling, I'd worry about the weight of the replacement product. Is there wood under the foam?
You might look at "headliner" material that they use in cars. It comes in many colors and is light weight. If you were in Knoxville I could tell you where to get it but you'll have to source it on the web yourself.
It has a foam backing that's about 1/4 inch thick and you'd use a spray adhesive to secure it. Use "3M"!!!! You'll have to deal with the seams though. Depending on the structure of your ceiling you may have to get creative. Maybe use some pre-finished "wood" trim that matches your RV or use trim and cover it with a matching or coordinating fabric.
You could staple the fabric to the top side of the trim, then screw the trim to the ceiling (with the fabric hanging down). After the trim is secured, you could wrap the trim with the fabric using more spray adhesive and tuck the non-stapled side in (over the top) with a butter knife. I did that in the bedroom with a 1x4. I added foam to the 1x4 after it was installed before I finished covering the board. Looks good.
PS: I cut a grove in the top of the 1x4 and used it to run some speaker wires.